<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../css/utils/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/utils/common.css" />
    <link rel="stylesheet" href="../../css/utils/bootstrap-datetimepicker.css" />
    <link rel="stylesheet" href="../../css/utils/toastr.min.css" />
	<title></title>
	<style>
		.btn-add-default {
			margin: 20px 0px;
			color: #11B5AB;
			background-color: #FFFFFF;
			border-color: #11B5AB;
		}
		td a {
			padding: 10px;
		    color: #11B5AB;
		    font-size: 15px;
		}
		td .btn {
			margin-right: 5px;
		}
		.btn-add-card {
			margin-left: 20px;
			color: #11B5AB;
			background-color: #FFFFFF;
			border-color: #11B5AB;
		}
		/*--------名片详情弹框---------*/
		.card-info-container {
			width: 100%;
			height: 300px;
		}
		.uiwm-cardinfo-top {
			float: left;
			margin-left: 50px;
			margin-top: 70px;
		}
		.uiwm-cardinfo-top:before, .uiwm-cardinfo-top:after {
		    display: table;
		    content: "";
		    line-height: 0;
		}
		.uiwm-cardinfo-top-avatar {
		    float: left;
		    width: 100px;
		    height: 100px;
		}
		.uiwm-cardinfo-top-avatar img {
		    border-radius: 50%;
		    width: 100%;
		    height: 100%;
		}
		.uiwm-cardinfo-top-detail {
		    float: left;
		}
		.uiwm-cardinfo-top:after {
		    clear: both;
		}
		.uiwm-cardinfo-top-detail li {
		    list-style: none;
		    line-height: 1.75;
		}
		.uiwm-cardinfo {
			float: right;
			width: 408px;
		    height: 80px;
		    margin-top: 80px;
		    margin-right: 50px;
		    position: relative;
		    border: 1px solid #d6d6d6;
		}
		.uiwm-cardinfo-detail {
			float: left;
		    width: 248px;
		}
		.uiwm-cardinfo-detail p {
		    font-size: 22px;
		    margin-left: 20px;
	        margin-top: 13px;
		    margin-bottom: 0;
		    color: #303030;
		}
		.text-base {
			margin-left: 10px;
			color: #999999;
		    font-size: 14px;
		}
		.big {
			margin-left: 20px;
			font-size: 16px;
		}
		.mptelephone{
			margin-left: 20px;
		    color: #999999;
		}
		.uiwm-cardinfo-header {
		    float: left;
		    margin-left: 31px;
		    margin-top: 17px;
			width: 46px;
			height: 46px;
			border-radius: 23px;
		}
		.uiwm-cardinfo-call{
		    height: 79px;
		    width: 80px;
	        line-height: 79px;
    			text-align: center;
		}
		.phone {
			background-color: #F3F3F3;
		}
		.wechat{
			background-color: #e3e3e3;
		}
		.uiwm-cardinfo-call img{
			width: 20px;
			height: 20px;
		}
		/*--------名片详情弹框---------*/
		/*--------新建名片和名片报名弹框---------*/
		.add-or-edit {
			height: 800px;
		}
		.m-t-md {
		    margin-top: 30px;
		}
		.text-red {
		    color: #ee4747;
		}
		.btn-primary:focus, .btn-primary:hover {
			color: #fff;
			background-color: #2aeee2;
			border-color: #2aeee2;
		}
		.btn-primary {
			padding: 6px 40px;
		    color: #fff;
		    background-color: #11B5AB;
		    border-color: #11B5AB;
		}
		.cancle {
			color: #7B7B7B;
			background-color: #F3F3F3;
		    border-color: #F3F3F3;
		}
		.modal-header .title-tips-span {
			margin-left: 10px;
			font-size: 12px;
			font-family: "MicrosoftYaHei";
			color: #666666;
		}
		.modal-header .title-span {
			font-size: 15px;
			font-family: "MicrosoftYaHei-Bold";
			color: #666666;
		}
		.text-xs img{
			width: 14px;
			height: 14px;
		}
		.add-edit-uiwm-cardinfo {
			width: 408px;
		    height: 80px;
		    margin: 20px 0px 20px 15px;
		    float: left;
		    position: relative;
		    border: 1px solid #d6d6d6;
		}
		/*--------新建名片和修改名片弹框---------*/
		/*--------新建报名和修改报名弹框---------*/
		.add-edit-enroll {
			border-radius: 4px;
			width: 1100px;
			height: 800px;
			background-color: #FFFFFF;
		}
		.uiwm-preview-left {
		    margin: 5px 85px 15px 65px;
		    float: left;
		    width: 276px;
		    height: 576px;
		    background: url(../../img/myExtension/phone-model.png);
		    background-size: 100% 100%;
		    padding: 122px 23px 110px;
		    color: #666666;
		    position: relative;
		}
		.text-xs {
		    font-size: 12px !important;
		}
		.text-blue {
		    color: #168adc;
		}
		.text-black {
		    color: #333333;
	        font-size: 18px;
	        font-weight: 700;
		}
		.col-lg-4,.col-lg-6 {
			margin-top: 25px;
		}
		#previewContent {
		    overflow-x: hidden;
		    overflow-y: auto;
		}
		.uiwm-preview-signup {
		    position: absolute;
		    left: 14px;
		    bottom: 68px;
		    width: 247px;
		    height: 36px;
		    background: #fff;
		    border-top: 1px solid #d6d6d6;
		    box-shadow: 0px -1px 1px 0 #d6d6d6;
		}
		.uiwm-preview-signup .pull-left {
		    width: 170px;
		    padding: 2px 3px 0;
		}
		.m-n {
		    margin: 0 !important;
		}
		.text-sm {
		    font-size: 13px;
		}
		.uiwm-preview-signup .pull-right {
		    margin-right: 3px;
		    width: 67px;
		    padding-top: 5px;
		}
		.uiwm-preview-signup .pull-right a {
		    display: inline-block;
		    height: 24px;
		    font-size: 12px;
		    text-align: center;
		    line-height: 24px;
		    width: 60px;
		    border-radius: 4px;
		    background-color: #168adc;
		    color: #fff;
		}
		.uiwm-preview-signbg {
		    /*background: url(../image/wrapper-bg.png) no-repeat center;*/
		   	background-color: #11B5AB;
		    width: 247.5px;
		    height: 398px;
		    background-size: cover;
		    margin-left: -9px;
		    margin-top: -11px;
		    color: #fff;
		    text-align: center;
		    overflow: hidden;
		    position: absolute;
		    top: 122px;
		}
		.uiwm-preview-signbg h3 {
		    margin-top: 25.08px;
		    margin-bottom: 11.22px;
		    font-size: 16px;
		    line-height: 1;
		}
		.uiwm-preview-signbg #signContentPreview {
		    table-layout: fixed;
		    word-break: break-all;
		    overflow: hidden;
		    padding: 0 10px;
		    font-size: 9px;
		}
		.uiwm-preview-signbg .signForm {
		    margin: 10px;
		    margin-top: 12.54px;
		    width: 227.5px;
		}
		.uiwm-preview-signbg .signForm input {
		    margin: 6.6px 0;
		    height: 29.04px;
		    font-size: 10px;
		    color: #333333;
		    border: 0;
		}
		.getVerifyCode {
		    display: none;
		    position: relative;
		}
		.getVerifyCode span {
		    font-size: 12px;
		    position: absolute;
		    right: 10px;
		    top: 7px;
		    z-index: 10000000;
		    color: #5a93f3;
		    cursor: pointer;
		}
		.uiwm-preview-signbg .signForm textarea {
		    height: 80px;
		    margin-bottom: 16.5px;
		    border: 0;
		}
		.uiwm-preview-signbg .signForm .btn-warning {
		    background-color: #00d9d9;
		    margin-bottom: 6.6px;
		    color: #FFFFFF;
		}
		.uiwm-preview-signbg .signForm .btn-default {
		    color: #11b5ab;
		    background-color: #c1ffff;
		}
		#VerifyCode {
		    margin-left: 20px;
		}
		#VerifyCode input {
		    display: inline-block;
		    margin-right: 5px;
		    position: relative;
		    top: 2px;
		}
		/*--------新建报名和修改报名弹框---------*/
		/*--------新建门票/活动和修改门票弹框---------*/
		.add-edit-tickets {
			border-radius: 4px;
			width: 1100px;
			height: 800px;
			background-color: #FFFFFF;
		}
		.tips-div {
			padding-left: 0px;
		}
		.tips-div label {
			color: #666666;
			font-size: 12px;
		}
		.input-date {
			display: table-cell;
			width: 150px;
		}
		.no-padder {
			padding-left: 0px;
			padding-right: 0px;
		}
		.btn-group-div {
			margin-top: 50px;
		}
		.uiwm-preview-bottom {
		    position: absolute;
		    left: 14px;
		    bottom: 68px;
		    width: 100%;
		    padding: 5px;
		}
		.bottom-font-div {
			font-size: 12px;
			color: #666666;
		}
		.preview-activity-title {
			font-size: 16px;
			color: #333333;
		}
		.preview-activity-detail {
			font-size: 14px;
			color: #6c6c6c;
		}
		.preview-activity-tips {
			color: #898989;
			font-size: 12px;
		}
		.uiwm-preview-tickets-detail {
			margin-top: 15px;
			background-color: #FFFFFF;
		}
		.preview-ticket-price {
			font-size: 16px;
			color: #343434;
		}
		.preview-ticket-img {
			width: 80px;
			height: 80px;
			margin-bottom: 10px;
		}
		.mobile-container {
			padding: 110px 15px 110px;
		}
		.mobile-panel {
			padding: 5px;
			padding-bottom: 40px;
		    width: 245px;
    			height: 398px;
    			overflow: scroll;
    			background-color: #f2f3f4;
		}
		input[type=text].in-padding {
			padding: 0px;
			padding-left: 5px;	
		}
		.preview-activity-tkActTitle {
			font-size: 17px;
			color: #333333;
		}
		.line-div {
			margin-left: 3%;
			margin-top: 15px;
			margin-bottom: 15px;
			width: 94%;
			height: 1px;
			background-color: #F3F3F3;
		}
		.uiwm-preview-activity-detail {
			background-color: #FFFFFF;
			border-radius: 5px;
			margin-left: 2px;
			margin-right: 2px;
			padding: 10px;
			margin-top: 5px;
		}
		.activity-item {
			position: relative;
			margin-left: 2px;
			margin-right: 2px;
		}
		.preview-ticket-item-img {
			width: 233px;
			height: 80px;
		}
		.shadow-layer {
			width: 233px;
			height: 80px;
			text-align: center;
			position: absolute;
			top: 0px;
			left: 0px;
			background-image: url(../../img/myExtension/ticket_bg.png);
			background-size: 100% 100%;
		}
		.preview-activity-item-tips {
			position: absolute;
			left: 5px;
			bottom: 5px;
			color: #FFFFFF;
			font-size: 12px;
			text-align: left;
		}
		.preview-ticket-item-price {
			font-size: 14px;
			border-radius: 10px;
			background-color: #e3e4e5;
			padding: 5px 10px;
		}
		.preview-ticket-item-num {
			font-size: 14px;
			color: #B9B9B9;
			float: right;
			padding: 5px;
		}
		.preview-ticket-item-bottom {
			margin-top: 5px;
			margin-bottom: 5px;
		}
		/*--------新建门票/活动和修改门票弹框---------*/
		/*-----------新建商品MODEL-------*/
		.goods-preview {
			width: 30px;
			height: 30px;
		}
		.add-edit-goods {
			border-radius: 4px;
			width: 1100px;
			height: 800px;
			overflow-y: auto;
			background-color: #FFFFFF;
		}
		.upload-goods-img {
			display: inline-block;
			margin-top: 10px;
			margin-right: 10px;
			width: 70px;
			height: 70px;
			background: url(../../img/myExtension/upload-logo.png) no-repeat;
			background-size: 100% 100%;
		}
		.upload-goods-img input::-webkit-file-upload-button {
            width: 70px;
            height: 70px;
            border: none;
            position: absolute;
            outline: 0;
            opacity: 0;
        }
        .upload-goods-img input[type='file'] {
            display: block;
            width: auto;
            border: 0;
            vertical-align: middle;
        }
        .add-img {
        	background: url(../../img/myExtension/upload-add.png) no-repeat;
			background-size: 100% 100%;
        }
        .input-width100 {
        	display: inline-block;
        	width: 100px;
        }
        .input-width200 {
        	display: inline-block;
        	width: 200px;
        }
        .comments-img {
        	display: inline-block;
        	/*margin-right: 10px;*/
        }
        .close-div {
			position: relative;
			display: inline-block;
			width: 70px;
			margin-right: 10px;
		}
		.img-list {
			width: 70px;
			height: 70px;
			float: left;
		}
		.close-img {
			width: 15px;
			height: 15px;
			border-radius:50% ;
			float: right;
			position: absolute;
			top: -6px;
			right: -5px;
		}
		.delete-standard {
			float: right;
			margin-top: 8px;
			margin-right: 10px;
		}
		.carousel {
			height: 120px;
		}
		.carousel-inner {
			max-height: 120px;
		}
		.goods-price {
			margin-top: 10px;
			font-size: 16px;
			color: red;
		}
		.goods-name {
			color: #000;
			font-weight: bold;
		}
		.goods-font {
			margin-top: 10px;
			color: #666;
			font-size: 12px;
			text-align: center;
		}
		.goods-details img {
			text-align: center;
			max-width: 100%;
			height: auto;
		}
		.uiwm-preview-standard {
			display: none;
			position: absolute;
			left: 14px;
		    bottom: 68px;
		    width: 247px;
		    background-color: #fff;
			border-top: 1px solid #d6d6d6;
    		box-shadow: 0px -1px 1px 0 #d6d6d6;
		}
		.goods-logo {
			position: absolute;
			top: -10px;
			left: 20px;
			width: 70px;
			height: 70px;
			border: 1px solid #A1A1A1;
		}
		.goods-logo img {
			width: 100%;
    		height: 100%;
		}
		.standard-details {
			margin-left: 100px;
			margin-top: 5px;
			font-size: 13px;
		}
		.standard-price {
			color: red;
			font-size: 14px;
		}
		.standard-number {
			padding: 10px;
			height: 150px;
		}
		.label-group .label {
			display: inline-block;
			padding: 3px 25px;
			margin-right: 20px;
			margin-bottom: 20px;
			background-color: #E1E1E1;
			color: #848484;
			cursor: pointer;
			border-top-left-radius: 10px;
			border-top-right-radius: 10px;
			border-bottom-left-radius: 10px;
			border-bottom-right-radius: 10px;
		}
		.label-group .label.active {
			background-color: #11B5AB;
			color: #fff;
		}
		.pay-number {
			display: flex;
			justify-content: space-between;
		}
		.pay-number img {
			height: 28px;
		}
		.pay-btn {
			padding: 0 10px;
		}
		.pay-btn .btn {
			background-color: #f96b20;
			color: #fff;
			border-radius: 20px;
		}
		.modal-left {
		    margin: 30px 0 0 50px;
		}
		/**---------代金券---------**/
		.vouchers-container {
			width: 230px;
			height: 85px;
			background-image: url(../../img/myExtension/vouchers_bg.png);
			background-size: 100% 100%;
			position: relative;
		}
		.discount-container {
			width: 230px;
			height: 85px;
			background-image: url(../../img/myExtension/discount_bg.png);
			background-size: 100% 100%;
			position: relative;
		}
		.validity_time-div {
			position: absolute;
			bottom: 5px;
			left: 10px;
			width: 100%;
		}
		.validity_time {
			font-size: 8px;
			color: #FF8044;
		}
		.unused {
			float: right;
			font-size: 10px;
		    margin-top: 3px;
    			margin-right: 2px;
		}
		.get-vocuchers {
			position: absolute;
		    right: 13px;
    			top: 35px;
			font-size: 12px;
			color: #FF7C41;
		}
		.vouchers-price {
			padding-left: 10px;
    			padding-top: 25px;
		}
		.vouchers-price .symbol {
			text-align: end;
			font-size: 8px;
		}
		.vouchers-price .price {
			font-size: 22px;
			font-weight: 400;
		}
		.vouchers-price .title {
		    	font-size: 13px;
		    font-weight: 400;
		    vertical-align: text-bottom;
		}
		.vocuchers-color {
			color: #FF8044;
		}
		.discount-color {
			color: #FC4785;
		}
		#distribution {
			display: none;
		}
	</style>
</head>
<body>
	<div class="content">
		<div class="btn-group btn-group-justified btn-tab" role="group" aria-label="button-group">
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel1" class="btn btn-default active">名片</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel2" class="btn btn-default">报名</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel3" class="btn btn-default">活动</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel4" class="btn btn-default">门票</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel5" class="btn btn-default">商品</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel6" class="btn btn-default">代金券</button>
			</div>
			<div class="btn-group" role="group">
				<button type="button" panel-data="tab-panel7" class="btn btn-default">打折券</button>
			</div>
		</div>
		<div class="tab-content">
			<div id="tab-panel1" class="tab-pane active">
				<button class="btn btn-add-default" data-toggle="modal" data-target="#addAndEditCardModal">新建</button>
		  		<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>名片名称</th>
							<th>名字</th>
							<th>电话</th>
							<th>职位</th>
							<th>添加日期</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="cardtbody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel2" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" data-target="#addAndEditEnrollModal">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>活动标题</th>
							<th>活动介绍</th>
							<th>阅读人数</th>
							<th>参与人数</th>
							<th>转化率</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="enrolltbody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel3" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" data-target="#addAndEditActivityModal">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>活动主题</th>
							<th>活动开始时间</th>
							<th>活动结束时间</th>
							<th>承办方</th>
							<th>主办单位</th>
							<th>注意事项</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="activitytbody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel4" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" id="addTickets">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>其归属活动</th>
							<th>价钱</th>
							<th>转发次数可领取</th>
							<th>总数量</th>
							<th>领走数量</th>
							<th>剩余数量</th>
							<th>说明</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="ticketstbody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel5" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" id="addGoods">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>商品图片</th>
							<th>商品名称</th>
							<th>商品规格-价格</th>
							<th>创建时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="goodsBody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel6" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" data-target="#addAndEditVouchersModal">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>代金券价格</th>
							<th>满多少减</th>
							<th>开始时间</th>
							<th>结束时间</th>
							<th>剩余数量</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="vouchersBody">
					</tbody>
				</table>
			</div>
			<div id="tab-panel7" class="tab-pane">
				<button class="btn btn-add-default" data-toggle="modal" data-target="#addAndEditDiscountModal">新建</button>
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>序号</th>
							<th>折扣</th>
							<!--<th>折扣商品</th>-->
							<th>开始时间</th>
							<th>结束时间</th>
							<th>剩余数量</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="discountBody">
					</tbody>
				</table>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<span class="title-span mpusername"></span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="card-info-container">
				  			<div class="uiwm-cardinfo-top">
								<div class="uiwm-cardinfo-top-avatar">
									<img alt="名片头像" id="mptitle_img" src="../../img/myClients/header_img.png" />
								</div>
								<ul class="uiwm-cardinfo-top-detail">
									<li>姓　　名：<span class="mpusername"></span></li>
									<li>手机号码：<span class="mpphone"></span></li>
									<li>公司简称：<span class="mpcompaneyname"></span></li>
									<li>职　　位：<span class="mpjobstatus"></span></li>
								</ul>
				            </div>
							<div class="uiwm-cardinfo">
								<div class="uiwm-cardinfo-detail">
									<img class="uiwm-cardinfo-header" alt="名片头像" id="mp_img" src="../../img/myClients/header_img.png" />
									<p>
										<span class="text-base big mpusername"></span>
										<span class="text-base"><span class="mpjobstatus"></span></span>
									</p>
									<span class="mptelephone mpphone"></span>
								</div>
								<div class="uiwm-cardinfo-call phone" style="position: absolute;right:80px; top:0;">
									<img src="../../img/myExtension/phone.png" />
								</div>
								<div class="uiwm-cardinfo-call wechat" style="position: absolute;right:0; top:0;">
									<img src="../../img/myExtension/wechart.png" />
								</div>
							</div>
				  		</div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditCardModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditCardModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content add-or-edit">
					<div class="modal-header">
						<span class="title-span">编辑名片</span><span class="title-tips-span">名片设置后，必须插入文章内容中才可生效，支持在线拨打和发短信</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
					<form class="form-horizontal m-t-md nice-validator n-default" id="cardForm">
			            <div class="form-group">
			              <label for="recipient-name" class="control-label col-md-4"><span class="text-red">*</span> 名片名称：</label>
			              <div class="col-md-6">
			                <input type="text" class="form-control" value="" name="cardName"  placeholder="请填写名片名称" id="cardName">
			                <span class="text-xs text-gray-light">
			                		<img src="../../img/myExtension/tips.png"/>
			                  名片名称只用于管理，不显示在下发的名片内容中
			                </span>
			              </div>
			            </div>
			            <div class="form-group" id="container">
			              <label for="message-text" class="control-label col-md-4" style="padding-top:42px;"><span class="text-red">*</span> 头像设置：</label>
			              <div class="col-md-6 upload-btn100" title="点击修改名片" id="avatarContainer">
				              <img id="avatarUploader" src="../../img/myExtension/upload_img.png" class="avatar c-p" style="position: absolute; width:100px; height:100px; cursor:pointer" />
				              <input type="hidden" value="" name="headerImg" id="headerImg">
				              <a class="file-a">
				              	<input type="file" name="eidtorImg" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
				              </a>
			              </div>
			            </div>
			            <div class="form-group">
			              <label for="message-text" class="control-label col-md-4"><span class="text-red">*</span> 姓名：</label>
			              <div class="col-md-6">
			                <input type="text" class="form-control" v-model="mpname" name="memberName" placeholder="输入您的姓名" id="memberName" value="" >
			              </div>
			            </div>
			            <div class="form-group">
			              <label for="message-text" class="control-label col-md-4"><span class="text-red">*</span> 手机号码：</label>
			              <div class="col-md-6">
			                <input type="text" class="form-control" v-model="mptelephone" name="memberPhone" placeholder="输入您的电话号码" value="" id="memberPhone">
			              </div>
			            </div>
			            <div class="form-group" id="qrcode">
			              <label for="qrcodeUploader" class="control-label col-md-4" style="padding-top:42px;"><span class="text-red">*</span> 微信二维码：</label>
			              <div class="col-md-6 upload-btn100" title="点击修改二维码" id="qrcodeContainer">
			                  <img id="qrcodeUploader" src="../../img/myExtension/upload_img.png" class="avatar c-p" style="position: absolute; width:100px; height:100px; border-radius: 0;" />
			                  <input type="hidden" value="" name="memberQrcode" id="memberQrcode">
			                  <a class="file-a">
			                  	<input type="file" name="eidtorQrcode" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
			                  </a>
			              </div>
			            </div>
			            <div class="form-group">
			              <label for="message-text" class="control-label col-md-4"> 公司简称：</label>
			              <div class="col-md-6">
			                <input type="text" class="form-control" value="" name="memberCorpShort" id="memberCorpShort" readonly="readonly">
			              </div>
			            </div>
			            <div class="form-group">
			              <label for="message-text" class="control-label col-md-4"><span class="text-red">*</span> 职　　位：</label>
			              <div class="col-md-6">
			                <input type="text" class="form-control" v-model="mpjobposition" name="memberJob" value="" id="memberJob">
			              </div>
			            </div>
			            <div class="form-group">
			            		<label for="message-text" class="control-label col-md-4"></label>
				            <div class="add-edit-uiwm-cardinfo">
								<div class="uiwm-cardinfo-detail">
									<img class="uiwm-cardinfo-header" alt="名片头像" id="mfHeaderImg" />
									<p>
										<span class="text-base big" id="mfUsername"></span>
										<span class="text-base"><span class="mpjobstatus" id="mfPost"></span></span>
									</p>
									<span class="mptelephone" id="mfPhone"></span>
								</div>
								<div class="uiwm-cardinfo-call phone" style="position: absolute;right:80px; top:0;">
									<img src="../../img/myExtension/phone.png" />
								</div>
								<div class="uiwm-cardinfo-call wechat" style="position: absolute;right:0; top:0;">
									<img src="../../img/myExtension/wechart.png" />
								</div>
							</div>
						</div>
			            <div class="form-group">
			              <div class="col-md-offset-4 col-md-6 m-t-sm m-b-sm">
			              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
			                <button type="submit" id="save" class="btn btn-primary" >保存</button>
			              </div>
			            </div>
			          </form>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditEnrollModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditEnrollModalLabel">
			<div class="modal-dialog modal-lg add-edit-enroll" role="document">
				<div class="modal-content add-edit-enroll">
					<div class="modal-header">
						<span class="title-span">新建报名</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left" id="preview1" >
				              <div class="uiwm-preview-left-wrapper" id="previewContent">
				                <p class="preview-title text-md" id="activetitle">报名广告植入效果预览</p>
				                <p class="preview-subtitle text-xs">
				                  <span id="uiwm_timenow"></span>
				                  <span class="preview-author text-blue" id="wordauth">哈哈</span>
				                </p>
				                <div class="preview-content text-sm" id="activedesc">
				                  <p>友情提示：</p>
				                  <p>1.你可以在创作的内容和封装的链接中植入已添加好的报名活动广告</p>
				                  <p>2.报名广告的主题会显示在内容的最下方</p>
				                  <p>3.客户点击报名按钮可以进入报名信息提交页面</p>
				                  <p>4.客户在提交信息后，会跳转至你填写的跳转页面</p>
				                  <p>5.合适的内容，匹配合适的活动，会大幅度提升客户的关注度</p>
				                </div>
				              </div>
				              <div class="uiwm-preview-signup" id="previewSignup" style="height: auto; padding-top: 5px; padding-bottom: 5px;">
				                  <div class="clearfix" style="position: relative; width:100%;">
				                      <div class="pull-left">
				                          <h4 class="text-blue text-sm m-n" id="wordtitle"></h4>
				                          <!--<p class="text-xs text-gray-light m-n">已有10人报名，仅限30名</p>-->
				                      </div>
				                      <div class="pull-right" style="height:30px;">
				                          <a class="signupbtn" style="position: absolute; top:50%; margin-top:-12px;" href="javascript:;" id="signup"></a>
				                      </div>
				                  </div>
				              </div>
				              <div class="uiwm-preview-signbg hide" id="previewForm">
				                    <h3 id="signTitlePreview">让成交更快</h3>
				                    <p id="signContentPreview">让大家快速了解，如何开发客户<br/>如何快速和客户建立信任</p>
				                    <div class="signForm">
				                      <input type="text" placeholder="姓名" class="form-control input-sm">
				                      <input type="text" placeholder="电话" class="form-control input-sm">
				                      <p class="getVerifyCode" style="display: none;">
				                        <input type="text" placeholder="请输入您的验证码" class="form-control input-sm"><span>获取验证码</span>
				                      </p>
				                    <textarea type="text" id="msgPreview" placeholder="留言" class="form-control input-sm"></textarea>
				                    <button class="btn  btn-block btn-warning" type="button">提交</button>
				                    <button class="btn btn-block  btn-default" type="button">返回原文</button>
				                  </div>
				              </div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-7 m-t-md">
				          <form class="form-horizontal m-t-md" id="signupForm">
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black"> 广告位</label>
				            </div>
				            <div class="form-group">
				              <label  class="control-label col-md-3"><span class="text-red">*</span> 广告语：</label>
				              <div class="col-md-9">
				                <input type="text" class="form-control" value="" v-model="wordtitle" id="adv" placeholder="请填写广告引导语，如“快来加入我们吧”"  name="adname">
				              </div>
				            </div>
				            <div class="form-group">
				              <label  class="control-label col-md-3"><span class="text-red">*</span> 报名按钮：</label>
				              <div class="col-md-9">
				                <input type="text" class="form-control" value="" v-model="signup" id="advTitle" placeholder="立即报名" name="signupname">
				              </div>
				            </div>
				            <div class="form-group m-t-lg m-b-xl">
				              <label class="control-label col-md-3 text-black"> 报 名 页</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"><span class="text-red">*</span> 活动标题：</label>
				              <div class="col-md-9">
				                <input type="text" class="form-control" id="signTitle" v-model="activectitle" placeholder="请填写活动标题"  name="hdbtname">
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"><span class="text-red">*</span> 活动说明：</label>
				              <div class="col-md-9">
				                <textarea class="form-control" id="signContent" v-model="activedesc" name="hdsmname" style="height: 120px;" placeholder="请填写活动说明"></textarea>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 报名内容：</label>
				              <div class="col-md-9">
				                <label class="control-label text-left">姓名、电话</label>
				                <!--<label id="VerifyCode"><input name="VerifyCode" type="checkbox">获取验证码</label>-->
				              	<span class="msg-box n-right" style="display: none;" for="VerifyCode"></span>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 留言：</label>
				              <div class="col-md-9">
				                <input type="text" class="form-control" value="" id="messageSig" placeholder="留言" name="leavewordname">
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> 跳转链接：</label>
				              <div class="col-md-9">
				                <input type="text" class="form-control" value="" id="signUrl" placeholder="用户报名确认后跳转的URL页面，如公司官网，活动介绍等" name="urlname">
				              </div>
				            </div>
				            <div class="form-group">
				              <div class="col-md-offset-3 col-md-9 m-t-sm m-b-sm">
				              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
				                <button type="submit" class="btn btn-primary padder-md" id="save">保存</button>
				              </div>
				            </div>
				          </form>
				        </div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditTicketsModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditTicketsModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content add-edit-tickets">
					<div class="modal-header">
						<span class="title-span" id="addAndEditTicketsModalLabel">新建门票</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left mobile-container">
				            		<div class="mobile-panel">
				            			<div class="uiwm-preview-activity-detail">
						                <p class="preview-activity-tkActTitle" id="tkActTitle"></p>
						                <div class="line-div"></div>
						                <p class="preview-activity-detail" id="tkActDate">活动时间：</p>
						                <p class="preview-activity-detail" id="tkActAddr">活动地址：</p>
						                <p class="preview-activity-detail" id="tkActTips">你可以在创作的内容和封装的连接中植入已添 加好的报名活动广告</p>
						                <div class="line-div"></div>
						                <div class="bottom-font-div" id="tkActContractor">承办方:</div>
						              	<div class="bottom-font-div" id="tkActOrganizer">主办单位：</div>
					              	</div>
					              	<div class="uiwm-preview-tickets-detail">
					              		<div class="activity-item">
							          		<img id="ticketsImg" class="preview-ticket-item-img" src="../../img/myExtension/upload_img.png" />
							          		<div class="shadow-layer">
								          		<p id="ticketsExplain" class="preview-activity-item-tips">摘要：你可以在创作的内容和封装的连接中植 入已添加好的报名活动广告</p>
							          		</div>
							          		<div class="preview-ticket-item-bottom">
							          			<label id="ticketsPrice" class="preview-ticket-item-price">价格:免费</label>
							          			<label id="ticketsTranspondNumber" class="preview-ticket-item-num">转发n次可免费领票</label>
							          		</div>
						          		</div>
						          	</div>
				            		</div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-7 m-t-md">
				          <form class="form-horizontal" id="ticketsForm">
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black"> 门票</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> 上传图片：</label>
				              <div class="col-md-6 upload-btn100" title="点击修改门票图片">
				                  <img id="ticketsUploader" src="../../img/myExtension/upload_img.png" class="avatar c-p" style="position: absolute; width:100px; height:100px; border-radius: 0;" />
				                  <input type="hidden" value="" name="ticketsImgInput" id="ticketsImgInput">
				                  <a class="file-a">
				                  	<input type="file" id="editTickets" name="editTickets" accept="image/*" multiple onchange="handleInputChange(this);" />
				                  </a>
				              </div>
				            </div>
				            <div class="form-group">
				            		<label class="control-label col-md-3"> 选择活动:</label>
	                            <div class="col-md-8" style="position:relative">
	                              <select class="form-control no-shadow m-r-sm" id="activityIDSt">
	                                  <option value="">请选择属于活动</option>
	                              </select>
	                            </div>
	                        </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 价格:</label>
				              <div class="col-md-5">
				                <input type="text" class="form-control" id="ticketPrice" name="ticketPrice" placeholder="请填门票价格" onkeyup="value=value.replace(/[^\d]/g,'')" />
				              </div>
				              <div class="col-md-3 tips-div">
				              	<label class="control-label">元</label>
				              </div>
				            </div>
				            <div id="transpondNumberDiv" class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 转发次数:</label>
				              <div class="col-md-5">
				                <input type="text" class="form-control" id="transpondNumber" name="transpondNumber" placeholder="请填写转发次数">
				              </div>
				              <div class="col-md-3 tips-div">
				              	<label class="control-label">设定转发次数免费领票</label>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 说 明:</label>
				              <div class="col-md-8">
				                <textarea type="text" class="form-control" id="ticketsAbstract" name="ticketsAbstract" placeholder="请填写门票说 明"></textarea>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 数量:</label>
				              <div class="col-md-5">
				                <input type="text" class="form-control" id="ticketsNumber" name="ticketsNumber" placeholder="请填写门票数量">
				              </div>
				            </div>
				            <div class="form-group">
				              <div class="col-md-offset-3 col-md-8 m-t-sm m-b-sm">
				              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
				                <button type="submit" class="btn btn-primary padder-md" id="save">保存</button>
				              </div>
				            </div>
				          </form>
				        </div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditActivityModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditActivityModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content add-edit-tickets">
					<div class="modal-header">
						<span class="title-span" id="addAndEditActivityModalLabel">新建活动</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left">
				            		<div class="uiwm-preview-left-wrapper">
					                <p class="preview-activity-title">活动主题</p>
					                <p id="actTitle" class="preview-activity-detail"></p>
					                <img id="activityImg" class="preview-ticket-img" src="../../img/myExtension/upload_img.png" />
					                <p id="actDate" class="preview-activity-detail">活动时间：</p>
					                <p id="actAddr" class="preview-activity-detail">活动地址：</p>
					                <p class="preview-activity-detail">注意事项：</p>
					                <p id="actAttention" class="preview-activity-tips">你可以在创作的内容和封装的连接中植入已添 加好的报名活动广告</p>
				              	</div>
				              	<div class="uiwm-preview-bottom" id="previewSignup">
					              	<div id="actContractor" class="bottom-font-div">承办方:</div>
					              	<div id="actOrganizer" class="bottom-font-div">主办单位：</div>
				              	</div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-7 m-t-md">
				          <form class="form-horizontal" id="activityForm">
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black"> 活动</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> 上传图片：</label>
				              <div class="col-md-6 upload-btn100" title="点击修改活动图片">
				                  <img id="activityUploader" src="../../img/myExtension/upload_img.png" class="avatar c-p" style="position: absolute; width:100px; height:100px; border-radius: 0;" />
				                  <input type="hidden" value="" name="activityImgInput" id="activityImgInput">
				                  <a class="file-a">
				                  	<input type="file" id="editTctivity" name="editTctivity" accept="image/*" multiple onchange="handleInputChange(this);" />
				                  </a>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 主 题:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="activityTitle" name="activityTitle" placeholder="快来加入我们吧"/>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 活动时间:</label>
				              <div class="col-md-8">
				              	<label class="control-label col-md-2">开始</label>
					              <div class="col-md-4 no-padder">
					                <input type="text" class="form-control in-padding" id="cusStartTime" name="cusStartTime" placeholder="选择开始时间"/>
					              </div>
					              <label class="control-label col-md-2">结束</label>
					              <div class="col-md-4 no-padder">
					                <input type="text" class="form-control in-padding" id="cusEndTime" name="cusEndTime" placeholder="选择结束时间"/>
					              </div>
		                    	  </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 活动地址:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="activityAddr" name="activityAddr" placeholder="请填写活动地址"/>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 承 办 方:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="contractor" name="contractor" placeholder="请填写承办方名称"/>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 主办单位:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="organizer" name="organizer" placeholder="请填写主办单位"/>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 注意事项:</label>
				              <div class="col-md-8">
				                <textarea type="text" class="form-control" id="attention" name="attention" placeholder="请填写注意事项"></textarea>
				              </div>
				            </div>
				            <div class="form-group">
				              <div class="col-md-offset-3 col-md-8 btn-group-div">
				              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
				                <button type="submit" class="btn btn-primary padder-md" id="save">保存</button>
				              </div>
				            </div>
				          </form>
				        </div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="goodsModal" tabindex="-1" role="dialog" aria-labelledby="goodsModalLabel">
			<div class="modal-dialog modal-lg modal-left" role="document">
				<div class="modal-content add-edit-goods">
					<div class="modal-header">
						<span class="title-span" id="goodsModalLabel">新建商品</span>
				    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left">
				            	<div class="refresh-scroll">
									<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
									  <!-- Indicators -->
									  <ol class="carousel-indicators">
									    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
									    <!--<li data-target="#carousel-example-generic" data-slide-to="1"></li>
									    <li data-target="#carousel-example-generic" data-slide-to="2"></li>-->
									  </ol>
									  <!-- Wrapper for slides -->
									  <div class="carousel-inner" role="listbox">
									    <div class="item active">
									      <img src="../../img/myExtension/banner.png" alt="banner">
									      <div class="carousel-caption">
									      </div>
									    </div>
									    <!--<div class="item">
									      <img src="../../img/home/company_header.png" alt="banner">
									      <div class="carousel-caption">
									      </div>
									    </div>-->
									  </div>
									  <!-- Controls -->
									  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
									    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
									    <span class="sr-only">Previous</span>
									  </a>
									  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
									    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
									    <span class="sr-only">Next</span>
									  </a>
									</div>
									<div class="goods-price"></div>
									<div class="goods-name"></div>
									<div class="goods-font">商品详情</div>
									<div class="goods-details"></div>
				            	</div>
				            	<div class="uiwm-preview-standard">
				            		<div class="goods-logo"></div>
				            		<div class="standard-details">
				            			<div class="standard-price">¥</div>
				            			<div class="standard-stock">库存：</div>
				            			<div class="standard-limited">限购：0</div>
				            		</div>
				            		<div class="standard-number refresh-scroll">
				            			<div class="standard-select">
					            			<p>选择规格</p>
					            			<div class="label-group">
												<!--<span class="label label-default active">奶茶</span>-->
											</div>
					            		</div>
					            		<div class="pay-number">
					            			<span>购买数量</span>
					            			<img src="../../img/myExtension/pay-number.png" />
					            		</div>
				            		</div>
				            		<div class="pay-btn">
				            			<button type="button" class="btn btn-block">确&nbsp;&nbsp;认</button>
				            		</div>
				            	</div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-8 m-t-md">
				        	<form class="form-horizontal" id="goodsForm">
				        		<div class="form-group m-t-lg m-b-xl">
					              <label  class="control-label col-md-3 text-black">商品信息</label>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>商品标题:</label>
					              <div class="col-md-8">
					                <input type="text" class="form-control" maxlength="25" id="goodsTitle" name="goodsTitle" placeholder="商品标题"/>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>商品图片:</label>
					              <div class="col-md-8">
					              	<div class="upload-goods-img">
										<input type="hidden" name="goodsBanner" value="" />
										<input type="file" name="uploadBanner" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
									<div class="upload-goods-img">
										<input type="hidden" name="goodsBanner" value="" />
										<input type="file" name="uploadBanner" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
									<div class="upload-goods-img">
										<input type="hidden" name="goodsBanner" value="" />
										<input type="file" name="uploadBanner" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
									<div class="upload-goods-img">
										<input type="hidden" name="goodsBanner" value="" />
										<input type="file" name="uploadBanner" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
									<div class="upload-goods-img">
										<input type="hidden" name="goodsBanner" value="" />
										<input type="file" name="uploadBanner" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"><span class="text-red">*</span>上传预览图:</label>
					              <div class="col-md-6 upload-btn100" title="点击修改活动图片">
					                  <img id="goodsImgUploader" src="../../img/myExtension/upload_img.png" class="avatar c-p" style="position: absolute; width:100px; height:100px; border-radius: 0;" />
					                  <input type="hidden" value="" name="goodsImg" id="goodsImg">
					                  <a class="file-a">
					                  	<input type="file" id="uploadGoodsImg" name="uploadGoodsImg" accept="image/*" multiple onchange="handleInputChange(this);" />
					                  </a>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>商品价格:</label>
					              <div class="col-md-8">
					                <input type="text" class="form-control" maxlength="10" id="goodsPrice" name="goodsPrice" placeholder="商品价格"/>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>图文介绍:</label>
					              <div class="col-md-8">
					              	<div class="comments-img"></div>
					                <div class="upload-goods-img add-img">
										<input type="file" name="uploadImageText" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
									</div>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>运费:</label>
					              <div class="col-md-8">
					                <input type="number" class="form-control" maxlength="10" id="logisticsFee" name="logisticsFee" value="0" placeholder="运费，0为免运费"/>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> <span class="text-red">*</span>满多少免运费:</label>
					              <div class="col-md-8">
					                <input type="number" class="form-control" maxlength="10" id="freeLogistics" name="freeLogistics" value="0" placeholder="满多少金额可免运费，0为不免运费"/>
					              </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3">是否分销商品:</label>
					              <div class="col-md-8">
					                <input id="isDistribution" style="margin-top: 11px;" type="checkbox"> 
					              </div>
					            </div>
					            <div id="distribution">
					            	<div class="form-group">
						              <label class="control-label col-md-3"> <span class="text-red">*</span>一级分销收益:</label>
						              <div class="col-md-8">
						                <input type="number" id="incomeLevel1" class="form-control input-width200" maxlength="10" placeholder="0"/>
						              </div>
						            </div>
						            <div class="form-group">
						              <label class="control-label col-md-3"> <span class="text-red">*</span>二级分销收益:</label>
						              <div class="col-md-8">
						                <input type="number" id="incomeLevel2" class="form-control input-width200" maxlength="10" placeholder="0"/>
						              </div>
						            </div>
						            <!--<div class="form-group">
						              <label class="control-label col-md-3"> <span class="text-red">*</span>三级分销收益:</label>
						              <div class="col-md-8">
						                <input type="number" id="incomeLevel3" class="form-control input-width200" maxlength="10" placeholder="0"/>
						              </div>
						            </div>-->
									<div class="form-group">
						              <label class="control-label col-md-3"> <span class="text-red">*</span>海报背景图:</label>
						              <div class="col-md-8">
						                <div class="upload-goods-img add-img">
						                	<input type="hidden" id="posterBackImg" value="" />
											<input type="file" name="uploadPosterBackImg" value="" accept="image/*" multiple onchange="handleInputChange(this);" />
										</div>
						              </div>
						            </div>
						            <div class="form-group">
						              <label class="control-label col-md-3"> <span class="text-red">*</span>海报话术:</label>
						              <div class="col-md-8">
						                <input type="text" id="posterRemark" class="form-control" placeholder="个性话术"/>
						              </div>
						            </div>
					            </div>
					            <div class="form-group m-t-lg m-b-xl">
					              <label  class="control-label col-md-3 text-black">规格信息</label>
					            </div>
					            <div id="standardDiv">
					            	<div class="standard-group">
					            		<input name="standardID" type="hidden" />
							            <div class="form-group">
							              <label class="control-label col-md-3"> <span class="text-red">*</span>商品价格:</label>
							              <div class="col-md-8">
							                <input type="number" class="form-control" maxlength="10" name="standardPrice" placeholder="商品价格"/>
							              </div>
							            </div>
							            <div class="form-group">
							              <label class="control-label col-md-3"> <span class="text-red">*</span>规格描述:</label>
							              <div class="col-md-8">
							                <input type="text" class="form-control" maxlength="10" name="standardDescribe" placeholder="规格描述"/>
							              </div>
							            </div>
							            <div class="form-group">
							              <label class="control-label col-md-3"> <span class="text-red">*</span>库存:</label>
							              <div class="col-md-8">
							                <input type="number" class="form-control input-width100" maxlength="10" name="standardStock" placeholder="0"/>
							              </div>
							            </div>
							            <div class="form-group">
							              <label class="control-label col-md-3">每个限购:</label>
							              <div class="col-md-8">
							                <input type="number" class="form-control input-width100" maxlength="10" name="standardLimited" placeholder="0"/>
							                <span>0 代表不限购</span>
							                <!--<a style="float: right;margin-top: 8px;margin-right: 10px;">删除</a>-->
							              </div>
							            </div>
						            </div>
					            </div>
					            <div class="form-group">
					              <label class="control-label col-md-3"> </label>
					              <div class="col-md-8">
					                <button id="addStandard" type="button" class="btn btn-theme">添加一个规格</button>
					              </div>
					            </div>
					            <div class="form-group">
					              <div class="col-md-offset-3 col-md-8 m-t-sm m-b-sm">
					              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
					                <button type="submit" class="btn btn-primary padder-md" id="saveGoods">保存</button>
					              </div>
					            </div>
				        	</form>	
				        </div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="goodsOrderModal" tabindex="-1" role="dialog" aria-labelledby="goodsOrderModalLabel">
			<div class="modal-dialog modal-lg modal-left" role="document">
				<div class="modal-content add-edit-goods">
					<div class="modal-header">
						<span class="title-span" id="goodsOrderModalLabel">订单列表</span>
				    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div id="goodsOrderTable" class="table-list">
							<div class="table-btn">
								<button id="exportTable" class="btn btn-default" type="button">导出表格</button>
							</div>
							<table class="table table-bordered table-hover table-striped">
								<thead>
									<tr>
										<th>收货人姓名</th>
										<th>收货人号码</th>
										<th>收货人地址</th>
										<th>订单留言</th>
										<th>订单总额</th>
										<th>支付状态</th>
										<th>选择的规格</th>
										<th>单价</th>
										<th>购买数量</th>
										<th>下单时间</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							</table>
							<nav id="orderPage" class="text-center" aria-label="Page navigation">
								<ul class="pagination">
								</ul>
							</nav>
						</div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditVouchersModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditVouchersModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content add-edit-tickets">
					<div class="modal-header">
						<span class="title-span" id="addAndEditVouchersModalLabel">新建代金券</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left">
				            		<div class="vouchers-container">
				            			<div class="vouchers-price">
				            				<span class="symbol vocuchers-color">¥</span>
				            				<span id="vouchersPriceSpan" class="price vocuchers-color">0</span>
				            				<span class="title vocuchers-color">代金券</span>
				            			</div>
				            			<div class="validity_time-div">
				            				<span id="vouchersValidityTime" class="validity_time vocuchers-color"></span>
				            			</div>
				            			<div class="get-vocuchers vocuchers-color">立即领取</div>
				              	</div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-7 m-t-md">
				          <form class="form-horizontal" id="vouchersForm">
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black"> 代金券</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 价  格:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="vouchersPrice" name="vouchersPrice" placeholder="请填写代金券价格"/>
				              </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span>满多少减:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="fullRedPrice" name="fullRedPrice" placeholder="请填写满减价格，0为直接使用"/>
				              </div>
				            </div>
				            <!--<div class="form-group">
			            		<label class="control-label col-md-3"> 选择商品:</label>
	                            <div class="col-md-8" style="position:relative">
	                              <select class="form-control no-shadow m-r-sm goodsIDSt">
	                                  <option value="">请选择打折的商品</option>
	                              </select>
	                            </div>
	                        </div>-->
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 有效期:</label>
				              <div class="col-md-8">
				              	<label class="control-label col-md-3">开始时间</label>
					              <div class="col-md-3 no-padder">
					                <input type="text" class="form-control in-padding" id="vcStartTime" name="vcStartTime" placeholder="选择开始时间"/>
					              </div>
					              <label class="control-label col-md-3">结束时间</label>
					              <div class="col-md-3 no-padder">
					                <input type="text" class="form-control in-padding" id="vcEndTime" name="vcEndTime" placeholder="选择结束时间"/>
					              </div>
		                    	  </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 数  量:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="voucherNumber" name="voucherNumber" placeholder="请填写代金券数量"/>
				              </div>
				            </div>
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black">添加领取条件</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red"></span>转发阅读人数:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" name="shareReadCount" value="0" placeholder="请填写阅读人数,0为不设条件"/>
				              </div>
				            </div>
				            <div class="form-group">
			            		<label class="control-label col-md-3"> 选择转发文章:</label>
	                            <div class="col-md-8" style="position:relative">
	                              <select class="form-control no-shadow m-r-sm articleIDS">
	                                  <option value="">请选择转发的文章</option>
	                              </select>
	                            </div>
	                        </div>
				            <div class="form-group">
				              <div class="col-md-offset-3 col-md-8 btn-group-div">
				              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
				                <button type="submit" class="btn btn-primary padder-md" id="save">保存</button>
				              </div>
				            </div>
				          </form>
				        </div>
				  	</div>
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-lg" id="addAndEditDiscountModal" tabindex="-1" role="dialog" aria-labelledby="addAndEditDiscountModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content add-edit-tickets">
					<div class="modal-header">
						<span class="title-span" id="addAndEditDiscountModalLabel">新建打折券</span>
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				  	<div class="modal-body">
				  		<div class="col-lg-4">
				          <div class="uiwm-preview m-t-lg">
				            <div class="uiwm-preview-left">
				            		<div class="discount-container">
				            			<div class="vouchers-price">
				            				<span class="discount-color symbol">¥</span>
				            				<span id="discountPriceSpan" class="price discount-color">0</span>
				            				<span class="discount-color title">折</span>
				            			</div>
				            			<div class="validity_time-div">
				            				<span id="discountValidityTime" class="validity_time discount-color"></span>
				            			</div>
				            			<div class="get-vocuchers discount-color">立即领取</div>
				              	</div>
				            </div>
				          </div>
				        </div>
				        <div class="col-lg-7 m-t-md">
				          <form class="form-horizontal" id="discountForm">
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black"> 折扣券</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 折  扣:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="discountPrice" name="discountPrice" placeholder="请填写打折券折扣"/>
				              </div>
				            </div>
				            <!--<div class="form-group">
			            		<label class="control-label col-md-3"> 选择商品:</label>
	                            <div class="col-md-8" style="position:relative">
	                              <select class="form-control no-shadow m-r-sm goodsIDSt">
	                                  <option value="">请选择打折的商品</option>
	                              </select>
	                            </div>
	                        </div>-->
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 有效期:</label>
				              <div class="col-md-8">
				              	<label class="control-label col-md-3">开始时间</label>
					              <div class="col-md-3 no-padder">
					                <input type="text" class="form-control in-padding" id="dcStartTime" name="dcStartTime" placeholder="选择开始时间"/>
					              </div>
					              <label class="control-label col-md-3">结束时间</label>
					              <div class="col-md-3 no-padder">
					                <input type="text" class="form-control in-padding" id="dcEndTime" name="dcEndTime" placeholder="选择结束时间"/>
					              </div>
		                    	  </div>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red">*</span> 数  量:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" id="discountNumber" name="discountNumber" placeholder="请填写代金券数量"/>
				              </div>
				            </div>
				            <div class="form-group m-t-lg m-b-xl">
				              <label  class="control-label col-md-3 text-black">添加领取条件</label>
				            </div>
				            <div class="form-group">
				              <label class="control-label col-md-3"> <span class="text-red"></span>转发阅读人数:</label>
				              <div class="col-md-8">
				                <input type="text" class="form-control" name="shareReadCount" value="0" placeholder="请填写阅读人数,0为不设条件"/>
				              </div>
				            </div>
				            <div class="form-group">
			            		<label class="control-label col-md-3"> 选择转发文章:</label>
	                            <div class="col-md-8" style="position:relative">
	                              <select class="form-control no-shadow m-r-sm articleIDS">
	                                  <option value="">请选择转发的文章</option>
	                              </select>
	                            </div>
	                        </div>
				            <div class="form-group">
				              <div class="col-md-offset-3 col-md-8 btn-group-div">
				              	<button id="cancle" class="btn btn-primary cancle" data-dismiss="modal" aria-label="Close">取消</button>
				                <button type="submit" class="btn btn-primary padder-md" id="save">保存</button>
				              </div>
				            </div>
				          </form>
				        </div>
				  	</div>
				</div>
			</div>
		</div>
	</div>	
	<script type="text/javascript" src="../../js/utils/jquery-1.12.4.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.fr.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script type="text/javascript" src="../../js/utils/jquery.cookie.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.validate.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/page.js" ></script>
	<script type="text/javascript" src="../../js/utils/toastr.min.js" ></script>
	<script type="text/javascript">
		document.write('<script type="text/javascript" src="../../js/utils/boot.js?v='+new Date().getTime()+'" ><\/script>');
	</script>
	<script type="text/javascript">
		var userID = $.cookie("userID");
		var companyID = $.cookie("companyID");
		var companyName = $.cookie("companyName");
		var enrollID,cardID,ticketsID,activityID,goodsID,vouchersID,discountCouponsID;
		var orderParam = {},isInitOrder=true;
		$(function() {
			toastr.options = {
                "closeButton": true,
                "timeOut": 2000,
                "positionClass": "toast-center"
            };
            $("#memberCorpShort").val(companyName);
			getCardListInfo();
		})
		function getCardListInfo() {
			base.postData(base.url.getCardList, {userID:userID,companyID:companyID,type:1}, callbackGetCardList);
		}
		//名片列表返回
		function callbackGetCardList(data){
			if (data.success) {
				$("#cardtbody").html(getCardListHtml(data.context.cardList));
			}
		}
		function getCardListHtml(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>'
				html += '	<td>'+(index*1+1)+'</td>'
				html += '	<td class="name-td">'+list[index].cardName+'</td>'
				html += '	<td class="user-name">'+list[index].cardUserName+'</td>'
				html += '	<td class="phone-td">'+list[index].cardUserPhone+'</td>'
				html += '	<td class="post-td">'+list[index].post+'</td>'
				html += '	<td>'+list[index].createTime +'</td>'
				html += '	<td style="display: none;"><span class="headimg-url">'+list[index].cardHeadImgUrl+'</span><span class="wxqcimg-url">'+list[index].wxQcImgUrl+'</span><span class="company-name">'+list[index].companyName+'</span></td>'
				html += '	<td><button class="btn btn-default card-detail" data-cardID = "'+list[index].cardID+'">详情</button><button class="btn btn-default card-modify" data-cardID = "'+list[index].cardID+'">修改</button><button class="btn btn-default card-del" data-cardID = "'+list[index].cardID+'">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		//获取报名插件列表
		function getEnrollListInfo() {
			base.postData(base.url.getEnrollList, {userID:userID,companyID:companyID,type:1}, callbackGetEnrollList);
		}
		function callbackGetEnrollList(data){
			if (data.success) {
				$("#enrolltbody").html(getEnrollListHtml(data.context.enrollList));
			}
		}
		function getEnrollListHtml(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>'
				html += '	<td>'+(index*1+1)+'</td>'
				html += '	<td class="title-td">'+list[index].activityTitle+'</td>'
				html += '	<td class="desp-td">'+list[index].activityDesp+'</td>'
				html += '	<td>'+list[index].readNum+'</td>'
				html += '	<td>'+list[index].enrollNum +'</td>'
				html += '	<td>'+list[index].rate+'</td>'
				html += '	<td style="display: none;"><span class="enroll-btn">'+list[index].enrollButton+'</span><span class="advertisement-span">'+list[index].advertisement+'</span><span class="remark-span">'+list[index].remark+'</span><span class="link-span">'+list[index].link+'</span></td>'
				html += '	<td><button class="btn btn-default enroll-modify" data-enrollID = "'+list[index].enrollID+'">修改</button><button class="btn btn-default enroll-del" data-enrollID = "'+list[index].enrollID+'">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		var myDate = new Date();
		$(".btn-tab").on("click", "button", function(){
			$(".btn-tab button").removeClass("active");
			$(this).addClass("active");
			var panelId = $(this).attr("panel-data");
			if (panelId == "tab-panel1") {
				getCardListInfo();
			} else if (panelId == "tab-panel2") {
				getEnrollListInfo();
			} else if (panelId == "tab-panel3") {
				getActivityList();
			} else if (panelId == "tab-panel4") {
				getActivityList();
				getTicketsList();
			} else if (panelId == "tab-panel5") {
				getGoodsList();
			} else if (panelId == "tab-panel6") {
//				getGoodsList();
				getVouchersList();
				initArticleList();
			} else if (panelId == "tab-panel7") {
//				getGoodsList();
				getDiscountCouponsList();
				initArticleList();
			}
			$(".tab-content .tab-pane").removeClass("active");
			$("#"+panelId).addClass("active");
		});
		//名片详细
		$("#cardtbody").on("click", ".card-detail", function() {
			var _cardID = $(this).attr("data-cardID");
			base.postData(base.url.getCardInfo, {userID:userID,companyID:companyID,cardID:_cardID}, function(data) {
				if (data.success) {
					$(".mpusername").text(data.context.cardUserName);
					$(".mpphone").text(data.context.cardUserPhone);
					$(".mpcompaneyname").text(data.context.companyName);
					$(".mpjobstatus").text(data.context.post);
					$("#mptitle_img").attr("src", data.context.cardheadImgUrl);
					$("#mp_img").attr("src", data.context.cardheadImgUrl);
					$("#detailsModal").modal("show");
				} 
			});
		})
		//修改名片
		$("#cardtbody").on("click", ".card-modify", function() {
			cardID = $(this).attr("data-cardID");
			var _company = $(this).closest("tr").find(".company-name").text();
			var _phone = $(this).closest("tr").find(".phone-td").text();
			var _userName = $(this).closest("tr").find(".user-name").text();
			var _headImgUrl = $(this).closest("tr").find(".headimg-url").text();
			var _wxQcImgUrl = $(this).closest("tr").find(".wxqcimg-url").text();
			$("#cardName").val($(this).closest("tr").find(".name-td").text());
			$("#memberName").val(_userName);
			$("#memberPhone").val(_phone);
			$("#memberQrcode").val($(this).closest("tr").find(".wxqcimg-url").text());
			$("#memberCorpShort").val(_company);
			$("#memberJob").val($(this).closest("tr").find(".post-td").text());
			$("#avatarUploader").attr("src", _headImgUrl);
			$("#qrcodeUploader").attr("src", _wxQcImgUrl);
			$("#mfHeaderImg").attr("src", _headImgUrl);
			$("#headerImg").val(_headImgUrl);
			$("#mfUsername").text(_userName);
			$("#mfCompany").text(_company);
			$("#mfPhone").text(_phone)
			$("#addAndEditCardModal").modal("show");
		})
		//删除名片
		$("#cardtbody").on("click", ".card-del", function() {
			var msg = confirm("确定要删除名片吗！");
			if (msg == true){
				var _cardID = $(this).attr("data-cardID");
				base.postData(base.url.deleteCardInfo, {userID:userID,companyID:companyID,cardID:_cardID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getCardListInfo();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		})
		//修改活动详细
		$("#enrolltbody").on("click", ".enroll-modify", function() {
			enrollID = $(this).attr("data-enrollID");
			$("#adv").val($(this).closest("tr").find(".advertisement-span").text());
			$("#advTitle").val($(this).closest("tr").find(".enroll-btn").text());
			$("#signup").text($(this).closest("tr").find(".enroll-btn").text());
			$("#signTitle").val($(this).closest("tr").find(".title-td").text());
			$("#signContent").val($(this).closest("tr").find(".desp-td").text());
			$("#messageSig").val($(this).closest("tr").find(".remark-span").text());
			$("#signUrl").val($(this).closest("tr").find(".link-span").text());
			$("#addAndEditEnrollModal").modal("show");
		})
		//删除报名
		$("#enrolltbody").on("click", ".enroll-del", function() {
			var msg = confirm("确定要删除报名吗！");
			if (msg == true){
				var _enrollID = $(this).attr("data-enrollID");
				base.postData(base.url.deleteEnrollInfo, {userID:userID,companyID:companyID,enrollID:_enrollID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getEnrollListInfo();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		})
		var isNeedVerifyCode=0;//是否需要验证手机号码
        $("#VerifyCode").click(function(){
            var isck=$(this).find("input").is(":checked")
            if(isck){
              isNeedVerifyCode = 1
              $(".getVerifyCode").show()
            }else{
              isNeedVerifyCode = 0
              $(".getVerifyCode").hide()
            }
        })
        $('#memberName').bind('input propertychange', function() {
            $('#mfUsername').html($(this).val());
        });
        $('#memberPhone').bind('input propertychange', function() {
            $('#mfPhone').html($(this).val());
        });
        $('#memberJob').bind('input propertychange', function() {
        		$('#mfPost').html($(this).val());
        })	
        $('#memberName').bind('input propertychange', function() {
            $('#signContentPreview').html($(this).val());
        });
		$('#signContent').bind('input propertychange', function() {
            $('#signContentPreview').html($(this).val());
        });
        //留言
        $('#messageSig').bind('input propertychange', function() {
            $('#msgPreview').attr("placeholder",$(this).val());
        });
        $('#signTitle').bind('input propertychange', function() {
            $('#signTitlePreview').html($(this).val());
        });
        $('#advTitle').bind('input propertychange', function() {
            $('#signup').html($(this).val());
        });
        $('#adv').bind('input propertychange', function() {
            $('#wordtitle').html($(this).val());
        });
        $("#signTitle,#signContent,#signUrl,#messageSig").on("focus", function() {
          $("#previewContent").addClass("hide");
          $("#previewSignup").addClass("hide");
          $("#previewForm").removeClass("hide");
        });
        $("#adv,#advTitle").on("focus", function() {
          $("#previewContent").removeClass("hide");
          $("#previewSignup").removeClass("hide");
          $("#previewForm").addClass("hide");
        });
        $(".btn-add-default").on("click", function() {
          	initEnrollData();
          	initCardData();
          	initTicketsData();
          	initActivityData();
          	initVouchersData();
          	initDiscountData();
        });
        //上传INPUT
		function handleInputChange(obj){
			//先判断是否已有五张图片
			var fileData = event.target.files[0];
			var imgMasSize = 1024 * 1024 * 5; // 5MB
			// 检查文件类型
		    if(['jpeg', 'png', 'gif', 'jpg', 'bmp'].indexOf(fileData.type.split("/")[1]) < 0){
		        toastr.warning("文件类型仅支持 jpeg/png/gif/jpg!");
		        return;
		    }
		    // 文件大小限制
		    if(fileData.size > imgMasSize ) {
		        // 文件大小自定义限制
		        toastr.warning("文件大小不能超过5MB！");
		        return;
		    }
			uploadFile(obj,fileData);
		}
		//上传图片
		function uploadFile(obj,files){
			toastr.info("正在上传，请稍等...");
			var formData = new FormData();
			formData.append('Filedata', files);
			formData.append('type', 1);
			$.ajax({
	            url: base.url.uploadFile,
	            method: 'POST',
	            data: formData,
	            contentType: false, // 注意这里应设为false
	            processData: false,
	            cache: false,
	            success: function(data) {
	            console.log(data.obj);
	            		pingFileData(obj, data.obj);
	            },
	            error: function (jqXHR) {
	                toastr.warning(JSON.stringify(jqXHR));
	            }
	        })
		}
		function pingFileData(obj, fileUrl){
			if ($(obj).attr("name") == "eidtorImg") {
				$("#headerImg").val(fileUrl);
				$("#mfHeaderImg").val(fileUrl);
				$("#avatarUploader").attr("src", fileUrl);
			} else if ($(obj).attr("name") == "eidtorQrcode"){
				$("#memberQrcode").val(fileUrl);
				$("#qrcodeUploader").attr("src", fileUrl);
			} else if ($(obj).attr("name") == "editTickets") {
				$("#ticketsImgInput").val(fileUrl);
				$("#ticketsUploader").attr("src", fileUrl);
				$("#ticketsImg").attr("src", fileUrl);
			} else if ($(obj).attr("name") == "editTctivity") {
				$("#activityImgInput").val(fileUrl);
				$("#activityUploader").attr("src", fileUrl);
				$("#activityImg").attr("src", fileUrl);
			} else if ($(obj).attr("name") == "uploadBanner") {
				pinBanner(obj, fileUrl);
			} else if ($(obj).attr("name") == "uploadGoodsImg") {
				$("#goodsImgUploader").attr("src", fileUrl);
				$("#goodsImg").val(fileUrl);
				$(".goods-logo").html('<img src="'+fileUrl+'" />')
			} else if ($(obj).attr("name") == "uploadImageText") {
				pinImageText(obj, fileUrl);
			} else if ($(obj).attr("name") == "uploadPosterBackImg") {
				$("#posterBackImg").val(fileUrl);
				$(obj).closest(".upload-goods-img").css("background-image", "url("+fileUrl+")");
				$(obj).closest(".upload-goods-img").css("background-size", "100% 100%");
			}
		}
        $('#uiwm_timenow').text( myDate.toLocaleDateString());
		$("#signupForm").validate({
		    rules: {
		      adname: "required",
		      signupname: {
		        required: true,
		        maxlength: 4
		      },
		      hdbtname: "required",
		      hdsmname: "required",
		      leavewordname: "required",
		      urlname: {url: true}
		    },
		    messages: {
		      adname: "广告语不能为空",
		      signupname: {
		        required: "请输入报名按钮",
		        minlength: "报名按钮必需小于5个字"
		      },
		      hdbtname: "活动标题不能为空",
		      hdsmname: "活动说明不能为空",
		      leavewordname: "留言不能为空",
		      urlname: "请输入正确的url地址"
		    },
		    submitHandler: function() {
		    		var _signUrl = $("#signUrl").val();
		    		if (_signUrl != "" && _signUrl.indexOf("http") == -1) {
		    			_signUrl = "http://"+_signUrl;
		    		}
				var data = {
					userID:userID,
					companyID:companyID,
					enrollID:enrollID,
					advertisement:$("#adv").val(),
					enrollButton:$("#signup").text(),
					activityTitle:$("#signTitle").val(),
					activityDesp:$("#signContent").val(),
					remark:$("#messageSig").val(),
					link:_signUrl
				}
				base.postData(base.url.addEnrollInfo, data, function(data) {
					if (data.success) {
						initEnrollData();
						$("#addAndEditEnrollModal").modal("hide");
						toastr.success(data.msg);
						getEnrollListInfo();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		$("#cardForm").validate({
		    rules: {
		      cardName: "required",
		      memberName: "required",
		      memberPhone: {isPhone: true},
		      headerImg: "required",
		      memberQrcode: "required",
		      memberJob: "required"
		    },
		    messages: {
		      cardName: "名片名称不能为空",
		      memberName: "姓名不能为空",
		      memberPhone: {required: "请填写正确的手机号码"},
		      headerImg: "请上传头像",
		      memberQrcode: "请上传二维码",
		      memberJob: "职位不能为空"
		    },
		    submitHandler: function() {
				var data = {
					userID:userID,
					companyID:companyID,
					cardID:cardID,
					cardName:$("#cardName").val(),
					cardheadImgUrl:$("#headerImg").val(),
					cardUserName:$("#memberName").val(),
					cardUserPhone:$("#memberPhone").val(),
					wxQcImgUrl:$("#memberQrcode").val(),
					companyName:$("#memberCorpShort").val(),
					post:$("#memberJob").val()
				}
				base.postData(base.url.addCardInfo, data, function(data) {
					if (data.success) {
						initCardData();
						$("#addAndEditCardModal").modal("hide");
						toastr.success(data.msg);
						getCardListInfo();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		$("#ticketsForm").validate({
		    rules: {
		      ticketsImgInput: "required",
		      ticketPrice: "required",
		      transpondNumber: "required",
		      ticketsAbstract: "required",
		      ticketsNumber: "required"
		    },
		    messages: {
		      ticketsImgInput: "请上传门票图片",
		      ticketPrice: "门票价格不能为空",
		      transpondNumber: "转发次数不能为空",
		      ticketsAbstract: "门票说明不能为空",
		      ticketsNumber: "门票数量不能为空"
		    },
		    submitHandler: function() {
		    		var _activityID = $('#activityIDSt option:selected').val();
				var data = {
					userID:userID,
					companyID:companyID,
					ticketsID:ticketsID,
					img:$("#ticketsImgInput").val(),
					activityID:$("#activityIDSt").val(),
					price:$("#ticketPrice").val(),
					transpondNumber:$("#transpondNumber").val(),
					ticketsNumber:$("#ticketsNumber").val(),
					ticketsExplain:$("#ticketsAbstract").val()
				}
				base.postData(base.url.addTickets, data, function(data) {
					if (data.success) {
						initTicketsData();
						$("#addAndEditTicketsModal").modal("hide");
						toastr.success(data.msg);
						getTicketsList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		$("#activityForm").validate({
		    rules: {
		    	  activityImgInput: "required",
		      activityTitle: "required",
		      cusStartTime: "required",
		      cusEndTime: "required",
		      activityAddr: "required",
		      contractor: "required",
		      organizer: "required",
		      attention: "required"
		    },
		    messages: {
		    	  activityImgInput: "请上传活动图片",
		      activityTitle: "活动主题不能为空",
		      cusStartTime: "开始时间不能为空",
		      cusEndTime: "结束时间不能为空",
		      activityAddr: "活动地址不能为空",
		      contractor: "承办方不能为空",
		      organizer:"主办单位不能为空",
		      attention: "注意事项不能为空"
		    },
		    submitHandler: function() {
				var data = {
					userID:userID,
					companyID:companyID,
					activityID:activityID,
					activityImg: $("#activityImgInput").val(),
					theme:$("#activityTitle").val(),
					activityStartTime:$("#cusStartTime").val(),
					activityEndTime:$("#cusEndTime").val(),
					activityAddress:$("#activityAddr").val(),
					contractor:$("#contractor").val(),
					organizer:$("#organizer").val(),
					attention:$("#attention").val()
				}
				base.postData(base.url.addActivity, data, function(data) {
					if (data.success) {
						initActivityData();
						$("#addAndEditActivityModal").modal("hide");
						toastr.success(data.msg);
						getActivityList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		//提交成功后初始化输入框
		function initEnrollData() {
			enrollID = null;
			$("#adv").val("");
			$("#advTitle").val("");
			$("#signup").text("");
			$("#signTitle").val("");
			$("#signContent").val("");
			$("#messageSig").val("");
			$("#signUrl").val("");
		}
		//提交成功后初始化输入框
		function initCardData() {
			cardID = null;
			$("#cardName").val("");
			$("#memberName").val("");
			$("#memberPhone").val("");
			$("#memberQrcode").val("");
//			$("#memberCorpShort").val("");
			$("#memberJob").val("");
			$("#avatarUploader").attr("src", "../../img/myExtension/upload_img.png");
			$("#qrcodeUploader").attr("src", "../../img/myExtension/upload_img.png");
			$("#mfHeaderImg").attr("src", "../../img/myExtension/upload_img.png");
			$("#headerImg").val("");
			$("#mfUsername").text("");
			$("#mfCompany").text("");
			$("#mfPhone").text("")
		}
		//提交成功后初始化输入框
		function initTicketsData() {
			ticketsID = null;
			$("#ticketPrice").val("");
			$("#transpondNumber").val("");
			$("#ticketsAbstract").val("");
			$("#ticketsNumber").val("");
			$("#ticketsUploader").attr("src", "../../img/myExtension/upload_img.png");
			$("#ticketsImgInput").val("");
			$("#ticketsImg").attr("src", "../../img/myExtension/upload_img.png");
			$("#ticketsExplain").html("摘要：");
			$("#ticketsTranspondNumber").html("转发n次可免费领票");
			$("#tkActTitle").html("");
			$("#tkActDate").html("活动时间：");
			$("#tkActAddr").html("活动地址：");
			$("#tkActTips").html("注意事项：");
			$("#tkActContractor").html("承办方:");
			$("#tkActOrganizer").html("主办单位：");
		}
		//提交成功后初始化输入框
		function initActivityData() {
			activityID = null;
			$("#activityTitle").val("");
			$("#cusStartTime").val("");
			$("#cusEndTime").val("");
			$("#activityAddr").val("");
			$("#contractor").val("");
			$("#organizer").val("");
			$("#activityUploader").attr("src", "../../img/myExtension/upload_img.png");
			$("#activityImgInput").val("");
			$("#activityImg").attr("src", "../../img/myExtension/upload_img.png");
			$("#activityIDSt option:first").prop("selected", 'selected');
			$("#attention").val("");
			$("#actTitle").val("");
			$("#actDate").text("活动时间：");
			$("#actAddr").text("活动地址：");
			$("#actAttention").text("");
			$("#actContractor").text("承办方:");
			$("#actOrganizer").text("主办单位：");
		}
		//提交成功后初始化输入框
		function initVouchersData() {
			vouchersID = null;
			$("#vouchersPrice").val("");
			$("#fullRedPrice").val("");
			$("#cusStartTime").val("");
			$("#cusEndTime").val("");
			$('#vouchersValidityTime').html('');
			$('#vouchersPriceSpan').html('');
			$("input[name='shareReadCount']").val("");
			$(".articleIDS option:first").prop("selected", 'selected');
		}
		//提交成功后初始化输入框
		function initDiscountData() {
			$('#discountPrice').val('');
			$("input[name='shareReadCount']").val("");
			$(".articleIDS option:first").prop("selected", 'selected');
			$('#dcStartTime').val('');
			$('#dcEndTime').val('');
			$('#discountNumber').val('');
			$('#discountPriceSpan').html('0');
			$('#discountValidityTime').html('')
		}
		//日期选择
	    	$('#cusStartTime').datetimepicker({
		    format: 'yyyy-mm-dd hh:ii',
		    language: 'zh-CN',
		    minView: 0,
		    minuteStep:1,
		    autoclose: true
		}).on("click", function(ev) {
		    $("#cusStartTime").datetimepicker("setEndDate", $("#cusEndTime").val());
		}).on("changeDate", function(ev) {
		    $("#cusEndTime").datetimepicker("setStartDate", $("#cusStartTime").val());
		    $('#cusEndTime').datetimepicker('show');
		});
		$('#cusEndTime').datetimepicker({
		    format: 'yyyy-mm-dd hh:ii',
		    language: 'zh-CN',
		    minView: 0,
		    minuteStep:1,
		    autoclose: true
		}).on("click", function(ev) {
		    $("#cusEndTime").datetimepicker("setStartDate", $("#cusStartTime").val());
		}).on("changeDate", function(ev) {
		    $('#actDate').html("活动时间："+$('#cusStartTime').val()+"-"+$("#cusEndTime").val());
		});
		//获取门票插件列表
		function getTicketsList() {
			base.postData(base.url.getTicketsList, {userID:userID,companyID:companyID}, callbackGetTicketsList);
		}
		function callbackGetTicketsList(data){
			if (data.success) {
				$("#ticketstbody").html(getTicketsListHtml(data.context.ticketsList));
			}
		}
		function getTicketsListHtml(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>'
				html += '	<td>'+(index*1+1)+'</td>'
				html += '	<td>'+list[index].theme+'</td>'
				html += '	<td>'+list[index].price+'</td>'
				html += '	<td>'+(list[index].transpondNumber||"收费")+'</td>'
				html += '	<td>'+list[index].ticketsNumber+'</td>'
				html += '	<td>'+list[index].receiveNumber+'</td>'
				html += '	<td>'+list[index].remainNumber +'</td>'
				html += '	<td>'+list[index].ticketsExplain+'</td>'
				html += '	<td><button class="btn btn-default tickets-detail" data-ticketsID = "'+list[index].ticketsID+'">详细</button><button class="btn btn-default tickets-modify" data-ticketsID = "'+list[index].ticketsID+'">修改</button><button class="btn btn-default tickets-del" data-ticketsID = "'+list[index].ticketsID+'">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		//获取活动插件列表
		function getActivityList() {
			base.postData(base.url.getActivityList, {userID:userID,companyID:companyID}, callbackGetActivityList);
		}
		function callbackGetActivityList(data){
			if (data.success) {
				//获得活动下拉框对象
				var activitySt = document.getElementById("activityIDSt");
				var list = data.context.activityList;
				var html = '';
				for (var index in list) {
					var option = document.createElement("option");
		            option.value = list[index].activityID;
		            option.innerHTML = list[index].theme;
		            activitySt.appendChild(option);
					html+= getActivityListHtml(list[index], index);
				}
				activitySt.onchange = function() {//监听活动下拉选择框
					for (var i in list) {
						getActivityByIdData(this.value);
					}
				}
				$("#activitytbody").html(html);
			}
		}
		function getActivityListHtml(item, index) {
			var html = '';
			html += '<tr>'
			html += '	<td>'+(index*1+1)+'</td>'
			html += '	<td>'+item.theme+'</td>'
			html += '	<td>'+item.activityStartTime+'</td>'
			html += '	<td>'+item.activityEndTime+'</td>'
			html += '	<td>'+item.contractor +'</td>'
			html += '	<td>'+item.organizer+'</td>'
			html += '	<td>'+item.attention+'</td>'
			html += '	<td><button class="btn btn-default activity-modify" data-activityID = "'+item.activityID+'">修改</button><button class="btn btn-default activity-del" data-activityID = "'+item.activityID+'">删除</button></td>'
			html += '</tr>'
			return html;
		}
		function getActivityByIdData(activityID) {
			base.postData(base.url.getActivityById, {activityID:activityID}, function(data) {
				if (data.success) {
					$("#tkActTitle").html(data.context.theme);
					$("#tkActDate").html("活动时间："+data.context.activityStartTime+"-"+data.context.activityEndTime);
					$("#tkActAddr").html("活动地址："+data.context.activityAddress);
					$("#tkActTips").html("注意事项："+data.context.attention);
					$("#tkActContractor").html("承办方:"+data.context.contractor);
					$("#tkActOrganizer").html("主办单位："+data.context.organizer);
				} else {
					toastr.error(data.msg);
				}
			});
		}
		$("#ticketstbody").on("click", ".tickets-detail", function() {
			var _ticketsID = $(this).attr("data-ticketsID");
			window.parent.location = "../index.html?path=myExtension/ticketsDetail.html?ticketsID="+_ticketsID; 
		})
		//点击修改获取门票详细
		$("#ticketstbody").on("click", ".tickets-modify", function() {
			ticketsID = $(this).attr("data-ticketsID");
			base.postData(base.url.getTicketsById, {ticketsID:ticketsID}, function(data) {
				if (data.success) {
					//获得活动下拉框对象
			        var activitySt = document.getElementById("activityIDSt");
			        //遍历活动数据,并把活动的数据追加到option选项中
			        for (var i=0; i<activitySt.options.length; i++) {
			            if (activitySt.options[i].value == data.context.activityID){  
				            activitySt.options[i].selected = true; 
				            break;  
				        }
			        }
			        getActivityByIdData(data.context.activityID);//填充左侧手机模型图中活动的数据
					$("#ticketsImgInput").val(data.context.img);
					$("#ticketsUploader").attr("src", data.context.img);
					$("#ticketPrice").val(data.context.price);
					$("#transpondNumber").val(data.context.transpondNumber);
					$("#ticketsAbstract").val(data.context.ticketsExplain);
					$("#ticketsNumber").val(data.context.ticketsNumber);
					$("#addAndEditTicketsModal").modal("show");
					if (data.context.price*1 > 0) {
						$('#ticketsPrice').html("价格:"+data.context.price);
						$('#transpondNumber').val("0");
						$('#transpondNumberDiv').hide();
						$('#ticketsTranspondNumber').hide();
					} else {
						$('#ticketsPrice').html("价格:免费");
						$('#transpondNumberDiv').show();
						$('#ticketsTranspondNumber').show();
						$('#ticketsTranspondNumber').html("转发"+data.context.transpondNumber+"次可免费领票");
					}
					$('#ticketsExplain').html("摘要："+data.context.ticketsExplain);
					$('#ticketsImg').attr("src", data.context.img);
				} else {
					toastr.error(data.msg);
				}
			});
		})
		//删除门票
		$("#ticketstbody").on("click", ".tickets-del", function() {
			var msg = confirm("确定要删除门票吗！");
			if (msg == true){
				var _ticketsID = $(this).attr("data-ticketsID");
				base.postData(base.url.deleteTickets, {ticketsID:_ticketsID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getTicketsList();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		})
		$('#ticketPrice').bind('input propertychange', function() {
			if ($(this).val()*1 > 0) {
				$('#ticketsPrice').html("价格:"+$(this).val());
				$('#transpondNumber').val("0");
				$('#transpondNumberDiv').hide();
				$('#ticketsTranspondNumber').hide();
			} else {
				$('#ticketsPrice').html("价格:免费");
				$('#transpondNumberDiv').show();
				$('#ticketsTranspondNumber').show();
				$('#ticketsTranspondNumber').html("转发"+$(this).val()+"次可免费领票");
			}
        });
        $('#transpondNumber').bind('input propertychange', function() {
        		$('#ticketsTranspondNumber').html("转发"+$(this).val()+"次可免费领票");
        });
        $('#ticketsAbstract').bind('input propertychange', function() {
            $('#ticketsExplain').html("摘要："+$(this).val());
        });
        $("#addTickets").on("click", function() {
        		$("#addAndEditTicketsModal").modal("show");
        })
        $('#activityTitle').bind('input propertychange', function() {
        		$('#actTitle').html($(this).val());
        })
        $('#activityAddr').bind('input propertychange', function() {
            $('#actAddr').html("活动地址："+$(this).val());
        });
        $('#contractor').bind('input propertychange', function() {
            $('#actContractor').html("承办方:"+$(this).val());
        });
        $('#organizer').bind('input propertychange', function() {
            $('#actOrganizer').html("主办单位:"+$(this).val());
        });
        $('#attention').bind('input propertychange', function() {
            $('#actAttention').html("注意事项:"+$(this).val());
        });
        //点击修改获取活动详细
		$("#activitytbody").on("click", ".activity-modify", function() {
			activityID = $(this).attr("data-activityID");
			base.postData(base.url.getActivityById, {activityID:activityID}, function(data) {
				if (data.success) {
					$("#activityTitle").val(data.context.theme);
					$("#cusStartTime").val(data.context.activityStartTime);
					$("#cusEndTime").val(data.context.activityEndTime);
					$("#activityAddr").val(data.context.activityAddress);
					$("#contractor").val(data.context.contractor);
					$("#organizer").val(data.context.organizer);
					$("#attention").val(data.context.attention);
					$("#activityImgInput").val(data.context.activityImg);
					$("#activityUploader").attr("src", data.context.activityImg);
					$('#activityImg').attr("src", data.context.activityImg);
					$("#addAndEditActivityModal").modal("show");
					$("#actTitle").text(data.context.theme);
					$("#actDate").text("活动时间："+data.context.activityStartTime+"-"+data.context.activityEndTime);
					$("#actAddr").text("活动地址："+data.context.activityAddress);
					$("#actAttention").text(data.context.attention);
					$("#actContractor").text("承办方:"+data.context.contractor);
					$("#actOrganizer").text("主办单位："+data.context.organizer);
				} else {
					toastr.error(data.msg);
				}
			});
		})
		//删除活动
		$("#activitytbody").on("click", ".activity-del", function() {
			var msg = confirm("确定要删除活动吗！");
			if (msg == true){
				var _activityID = $(this).attr("data-activityID");
				base.postData(base.url.deleteActivity, {activityID:_activityID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getActivityList();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		});
		//商品
		function getGoodsList(){
			base.postData(base.url.getGoodsList, {userID:userID,companyID:companyID}, function(data){
				if (data.success) {
					var html = '';
					//获得活动下拉框对象
					$(".goodsIDSt").empty();
					var list = data.context.goodsList;
					for (var index in list) {
			            var option = '<option value="'+list[index].goodsId+'">'+list[index].title+'</option>';
			            $(".goodsIDSt").append(option);
					}
					$("#goodsBody").html(pinGoodsList(data.context.goodsList));
				}
			});
		}
		function pinGoodsList(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>';
				html += '	<td><input type="hidden" name="goodsID" value="'+list[index].goodsId+'" />'+(index*1+1)+'</td>';
				html += '	<td><img class="goods-preview" src="'+list[index].previewImg+'"></td>';
				html += '	<td>'+list[index].title+'</td>';
				html += '<td>';
				for (var j in list[index].goodsSpecList) {
					html += '规格描述：'+list[index].goodsSpecList[j].specName+'&nbsp;&nbsp;&nbsp;商品价格：'+list[index].goodsSpecList[j].specPrice+'&nbsp;&nbsp;库存：'+list[index].goodsSpecList[j].stock+'<br />';
				}
				html += '</td>';
				
				html += '	<td>'+list[index].updateTime+'</td>'
				html += '	<td><button class="btn btn-default btn-theme goods-order">订单管理</button><button class="btn btn-default goods-edit">修改</button><button class="btn btn-default goods-del">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		$("#addGoods").click(function(){
			initGoodsModal();
			$("#goodsModal").modal("show");
		});
		function pinBanner(obj, fileUrl) {
			$(".uiwm-preview-standard").hide();
			$(obj).closest(".upload-goods-img").css("background-image", "url("+fileUrl+")");
			$(obj).closest(".upload-goods-img").css("background-size", "100% 100%");
			$(obj).closest(".upload-goods-img").find("input[name='goodsBanner']").val(fileUrl);
			var ol = '',imgs = '';
			$("input[name='goodsBanner']").each(function(index, item){
				if ($(this).val() != "") {
					if (index == 0) {
						ol += '<li data-target="#carousel-example-generic" data-slide-to="'+index+'" class="active"></li>';
						imgs += '<div class="item active">'+
							    '  <img src="'+$(this).val()+'" alt="banner">'+
							    '  <div class="carousel-caption">'+
							    '  </div>'+
							    '</div>';
					}else{
						ol += '<li data-target="#carousel-example-generic" data-slide-to="'+index+'"></li>';
						imgs += '<div class="item">'+
							    '  <img src="'+$(this).val()+'" alt="banner">'+
							    '  <div class="carousel-caption">'+
							    '  </div>'+
							    '</div>';
					}
				}
			});
			$(".carousel-indicators").html(ol);
			$(".carousel-inner").html(imgs);
		}
		$("#goodsTitle").bind("input propertychange", function(){
			$(".uiwm-preview-standard").hide();
			$(".goods-name").html($(this).val());
		});
		$("#goodsPrice").bind("input propertychange", function(){
			$(".uiwm-preview-standard").hide();
			$(".goods-price").html("¥"+$(this).val());
		});
		function pinImageText(obj, fileUrl){
			$(".uiwm-preview-standard").hide();
			var imgs = '<div class="close-div">'+
					   '	<img class="img-list" src="'+fileUrl+'"/>'+
					   '	<img class="close-img" src="../../img/myExtension/close.png"/>'+
					   '</div>';
			$(".comments-img").append(imgs);
			imgs = '';
			$(".comments-img").find("img.img-list").each(function(index, item){
				imgs += '<div><img src="'+$(this).attr('src')+'"/></div>';
			});
			$(".goods-details").html(imgs);
		}
		$(".comments-img").on("click", ".close-img", function(){
			$(".uiwm-preview-standard").hide();
			$(this).closest(".close-div").remove();
		});
		$("#addStandard").click(function(){
			$(".uiwm-preview-standard").show();
			var html = '<div class="standard-group">'+
					   ' <input name="standardID" type="hidden" />'+	
					   ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>商品价格:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control" maxlength="10" name="standardPrice" placeholder="商品价格"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>规格描述:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="text" class="form-control" maxlength="10" name="standardDescribe" placeholder="规格描述"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>库存:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardStock" placeholder="0"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3">每个限购:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardLimited" placeholder="0"/>'+
			           '     <span>0 代表不限购</span>'+
			           '     <a href="javascript:void(0);" class="delete-standard">删除</a>'+
			           '   </div>'+
			           ' </div>'+
			           '</div>';
			$("#standardDiv").append(html);           
		});
		$("#standardDiv").on("input propertychange", "input[name='standardPrice']", function(){
			$(".uiwm-preview-standard").show();
			$(".standard-price").html("¥"+$(this).val());
		});
		$("#standardDiv").on("input propertychange", "input[name='standardStock']", function(){
			$(".uiwm-preview-standard").show();
			$(".standard-stock").html("库存："+$(this).val());
		});
		$("#standardDiv").on("input propertychange", "input[name='standardLimited']", function(){
			$(".uiwm-preview-standard").show();
			$(".standard-limited").html("限购："+$(this).val());
		});
		$("#standardDiv").on("input propertychange", "input[name='standardDescribe']", function(){
			$(".uiwm-preview-standard").show();
			var span = "";
			var nowVal = $(this).val();
			$("#standardDiv").find("input[name='standardDescribe']").each(function(index, item){
				if (nowVal == $(this).val()) {
					span += '<span class="label label-default active">'+$(this).val()+'</span>';
				}else{
					span += '<span class="label label-default">'+$(this).val()+'</span>';
				}
			});
			$(".label-group").html(span);
		});
		$("#standardDiv").on("click", ".delete-standard", function(){
			$(this).closest(".standard-group").remove();
		});
		$("#goodsForm").validate({
		    rules: {
		      goodsTitle: "required",
		      goodsPrice: "required",
		      logisticsFee: "required",
		      freeLogistics: "required",
		      standardPrice: "required",
		      standardDescribe: "required",
		      standardStock: "required"
		    },
		    messages: {
		      goodsTitle: "商品标题不能为空",
		      goodsPrice: "商品价格不能为空",
		      logisticsFee: "物流费用不能为空，可填0",
		      freeLogistics: "满多少金额免物流不能为空，可填0",
		      standardPrice: "商品规格价格不能为空",
		      standardDescribe: "规格描述不能为空",
		      standardStock: "规格库存不能为空"
		    },
		    submitHandler: function() {
		    	var isGoodsBanner = true;
		    	var bannerImg = "";
		    	$("input[name='goodsBanner']").each(function(index, item){
		    		if ($(this).val() != "") {
		    			isGoodsBanner = false;
		    			bannerImg += $(this).val()+",";
		    		}
		    	});
		    	if (isGoodsBanner) {
		    		toastr.error("请上传商品图片！");
		    		return;
		    	}
		    	var goodsImg = $("#goodsImg").val();
		    	if (goodsImg == null || goodsImg == "") {
		    		toastr.error("请上传商品预览图！");
		    		return;
		    	}
		    	var isImageText = true;
		    	var imgText = "";
		    	$(".comments-img").find("img.img-list").each(function(index, item){
		    		isImageText = false;
		    		imgText += $(this).attr('src') + ",";
				});
				if (isImageText) {
		    		toastr.error("请上传商品图片介绍！");
		    		return;
		    	}
				if ($("#isDistribution").prop("checked")) {
					if ($("#incomeLevel1").val() == "") {
						toastr.error("请填写一级分销收益！");
						return;
					}
					if ($("#incomeLevel2").val() == "") {
						toastr.error("请填写二级分销收益！");
						return;
					}
					/*if ($("#incomeLevel3").val() == "") {
						toastr.error("请填写三级分销收益！");
						return;
					}*/
					if ($("#posterBackImg").val() == "") {
						toastr.error("请上传海报背景图！");
						return;
					}
					if ($("#posterRemark").val() == "") {
						toastr.error("请填写海报话术！");
						return;
					}
				}
				var isStandardPrice = false;
				$("#standardDiv").find("input[name='standardPrice']").each(function(index, item){
					if ($(this).val() == "") {
		    			isStandardPrice = true;
					}
				});
				if (isStandardPrice) {
					toastr.error("请填写商品规格价格！");
					return;
				}
				var isStandardDescribe = false;
				$("#standardDiv").find("input[name='standardDescribe']").each(function(index, item){
					if ($(this).val() == "") {
						isStandardDescribe = true;
					}
				});
				if (isStandardDescribe) {
					toastr.error("请填写商品规格描述！");
	    			return;
				}
				var isStandardStock = false;
				$("#standardDiv").find("input[name='standardStock']").each(function(index, item){
					if ($(this).val() == "") {
						isStandardStock = true;
					}
				});
				if (isStandardStock) {
					toastr.error("请填写商品规格库存！");
	    			return;
				}
				var goodsSpecList = new Array();
				$("#standardDiv").find(".standard-group").each(function(index, item){
					goodsSpecList.push({
							id:$(this).find("input[name='standardID']").val(),
							specPrice:$(this).find("input[name='standardPrice']").val(),
							specName:$(this).find("input[name='standardDescribe']").val(),
							stock:$(this).find("input[name='standardStock']").val(),
							constraintPurchase:$(this).find("input[name='standardLimited']").val()
						})
				});
				goodsSpecList = JSON.stringify(goodsSpecList);
				var data = {
					userID:userID,
					companyID:companyID,
					goodsID:goodsID,
					bannerImg:bannerImg,
					previewImg:goodsImg,
					imgText:imgText,
					title:$("#goodsTitle").val(),
					price:$("#goodsPrice").val(),
					logisticsFee:$("#logisticsFee").val(),
					freeLogistics:$("#freeLogistics").val(),
					isDistribution:$("#isDistribution").prop("checked")?"1":"0",
					incomeLevel1:$("#incomeLevel1").val(),
					incomeLevel2:$("#incomeLevel2").val(),
//					incomeLevel3:$("#incomeLevel3").val(),
					incomeLevel3:0,
					posterRemark:$("#posterRemark").val(),
					posterBackImg:$("#posterBackImg").val(),
					goodsSpecList:goodsSpecList
				}
				base.postData(base.url.addGoods, data, function(data) {
					if (data.success) {
						initGoodsModal();
						$("#goodsModal").modal("hide");
						toastr.success(data.msg);
						getGoodsList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		//初始化输入框
		function initGoodsModal(){
			goodsID = null;
			$("#goodsModal").find("input").val("");
			$("#goodsModal").find(".upload-goods-img").css("background-image", "url(../../img/myExtension/upload-logo.png)");
			$("#goodsModal").find(".upload-goods-img").css("background-size", "100% 100%");
			$("#goodsImgUploader").attr("src", "../../img/myExtension/upload_img.png");
			$(".goods-logo").html('');
			$(".comments-img").html('');
			$("#isDistribution").prop("checked", false);
			$("#distribution").hide();
			var html = '<div class="standard-group">'+
			           ' <input name="standardID" type="hidden" />'+
					   ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>商品价格:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control" maxlength="10" name="standardPrice" placeholder="商品价格"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>规格描述:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="text" class="form-control" maxlength="10" name="standardDescribe" placeholder="规格描述"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3"> <span class="text-red">*</span>库存:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardStock" placeholder="0"/>'+
			           '   </div>'+
			           ' </div>'+
			           ' <div class="form-group">'+
			           '   <label class="control-label col-md-3">每个限购:</label>'+
			           '   <div class="col-md-8">'+
			           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardLimited" placeholder="0"/>'+
			           '     <span>0 代表不限购</span>'+
			           '   </div>'+
			           ' </div>'+
			           '</div>';
			$("#standardDiv").html(html);
			$(".carousel-indicators").html('<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>');
			var imgs = '<div class="item active">'+
					   '   <img src="../../img/myExtension/banner.png" alt="banner">'+
					   '   <div class="carousel-caption">'+
					   '   </div>'+
					   ' </div>';
			$(".carousel-inner").html(imgs);
			$(".uiwm-preview-standard").hide();
			$(".goods-name").html("");
			$(".goods-price").html("");
			$(".goods-details").html("");
			$(".standard-price").html("¥");
			$(".standard-stock").html("库存：");
			$(".standard-limited").html("限购：");
			$(".label-group").html("");
		}
		$("#goodsBody").on("click", ".goods-edit", function(){
			goodsID = $(this).closest("tr").find("input[name='goodsID']").val();
			base.postData(base.url.getOneGoods, {companyID:companyID, goodsID:goodsID}, function(data){
				if (data.success) {
					$("#goodsModal").modal("show");
					$("#goodsTitle").val(data.context.title);
					$(".goods-name").html(data.context.title);
					$("#goodsPrice").val(data.context.price);
					$("#logisticsFee").val(data.context.logisticsFee);
					$("#freeLogistics").val(data.context.freeLogistics);
					$(".goods-price").html("¥"+data.context.price);
					
					var ol = '',imgs = '';
					for (var index in data.context.BannerImgList) {
						$("#goodsModal").find(".upload-goods-img").each(function(i, item){
							if (index == i) {
								$(item).css("background-image", "url("+data.context.BannerImgList[index]+")");
								$(item).find("input[name='goodsBanner']").val(data.context.BannerImgList[index]);
							}
						});
						if (index == 0) {
							ol += '<li data-target="#carousel-example-generic" data-slide-to="'+index+'" class="active"></li>';
							imgs += '<div class="item active">'+
								    '  <img src="'+data.context.BannerImgList[index]+'" alt="banner">'+
								    '  <div class="carousel-caption">'+
								    '  </div>'+
								    '</div>';
						}else{
							ol += '<li data-target="#carousel-example-generic" data-slide-to="'+index+'"></li>';
							imgs += '<div class="item">'+
								    '  <img src="'+data.context.BannerImgList[index]+'" alt="banner">'+
								    '  <div class="carousel-caption">'+
								    '  </div>'+
								    '</div>';
						}
					}
					$(".carousel-indicators").html(ol);
					$(".carousel-inner").html(imgs);
					$("#goodsImgUploader").attr("src", data.context.previewImg);
					$("#goodsImg").val(data.context.previewImg);
					$(".goods-logo").html('<img src="'+data.context.previewImg+'" />');
					var imgText = "",imgTextShow = "";
					for(var index in data.context.imgText) {
						imgText += '<div class="close-div">'+
								   '	<img class="img-list" src="'+data.context.imgText[index]+'"/>'+
								   '	<img class="close-img" src="../../img/myExtension/close.png"/>'+
								   '</div>';
						imgTextShow += '<div><img src="'+data.context.imgText[index]+'"/></div>';		   
					}
					$(".comments-img").html(imgText);
					$(".goods-details").html(imgTextShow);
					if (data.context.isDistribution == 1) {
						$("#isDistribution").prop("checked", true);
						$("#distribution").show();
					}else{
						$("#isDistribution").prop("checked", false);
						$("#distribution").hide();
					}
					$("#incomeLevel1").val(data.context.incomeLevel1);
					$("#incomeLevel2").val(data.context.incomeLevel2);
//					$("#incomeLevel3").val(data.context.incomeLevel3);
					$("#posterRemark").val(data.context.posterRemark);
					$("#posterBackImg").val(data.context.posterBackImg);
					$("#posterBackImg").closest(".upload-goods-img").css("background-image", "url("+data.context.posterBackImg+")");
					$("#posterBackImg").closest(".upload-goods-img").css("background-size", "100% 100%");
					var standardHtml = "",span="";
					for (var index in data.context.goodsSpecList) {
						standardHtml += '<div class="standard-group">'+
					           ' <input name="standardID" type="hidden" value="'+data.context.goodsSpecList[index].id+'" />'+
							   ' <div class="form-group">'+
					           '   <label class="control-label col-md-3"> <span class="text-red">*</span>商品价格:</label>'+
					           '   <div class="col-md-8">'+
					           '     <input type="number" class="form-control" maxlength="10" name="standardPrice" value="'+data.context.goodsSpecList[index].specPrice+'" placeholder="商品价格"/>'+
					           '   </div>'+
					           ' </div>'+
					           ' <div class="form-group">'+
					           '   <label class="control-label col-md-3"> <span class="text-red">*</span>规格描述:</label>'+
					           '   <div class="col-md-8">'+
					           '     <input type="text" class="form-control" maxlength="10" name="standardDescribe" value="'+data.context.goodsSpecList[index].specName+'" placeholder="规格描述"/>'+
					           '   </div>'+
					           ' </div>'+
					           ' <div class="form-group">'+
					           '   <label class="control-label col-md-3"> <span class="text-red">*</span>库存:</label>'+
					           '   <div class="col-md-8">'+
					           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardStock" value="'+data.context.goodsSpecList[index].stock+'" placeholder="0"/>'+
					           '   </div>'+
					           ' </div>'+
					           ' <div class="form-group">'+
					           '   <label class="control-label col-md-3">每个限购:</label>'+
					           '   <div class="col-md-8">'+
					           '     <input type="number" class="form-control input-width100" maxlength="10" name="standardLimited" value="'+data.context.goodsSpecList[index].constraintPurchase+'" placeholder="0"/>'+
					           '     <span>0 代表不限购</span>';
					           if (index != 0) {
					    standardHtml += '     <a href="javascript:void(0);" class="delete-standard">删除</a>';
					           }
					    standardHtml += '   </div>'+
					           ' </div>'+
					           '</div>';
				    }       
					$("#standardDiv").html(standardHtml);
					
				}
			});
		});
		$("#goodsBody").on("click", ".goods-del", function(){
			var msg = confirm("确定要删除商品吗！");
			if (msg){
				var _goodsID = $(this).closest("tr").find("input[name='goodsID']").val();
				base.postData(base.url.delGoods, {goodsID:_goodsID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getGoodsList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
			}
		});	
		$("#goodsBody").on('click', '.goods-order', function(){
			var _goodsID = $(this).closest("tr").find("input[name='goodsID']").val();
			orderParam = {
				goodsID:_goodsID,
				pageNo:1
			}
			base.postData(base.url.getGoodsOrderSpecListByGoodsId, orderParam, function(data) {
				if (data.success) {
					isInitOrder = true;
					$("#goodsOrderModal").modal("show");
					goodsOrderList(data.context);
				} else {
					toastr.error(data.msg);
				}
			});
		});
		function goodsOrderList(data) {
			var html = "";
			for (var i in data.orderList) {
				html += pingOrderList(data.orderList[i]);
			}
			$("#goodsOrderTable tbody").html(html);
			if (isInitOrder){
				isInitOrder = false;
				//初始化分页
				var totalPage = Math.ceil(data.totalPage/10);
				if (totalPage == 0) {
					totalPage = 1;
				}
				var page = {
					pageIndex:1,//初始页数
					currentPage:1,//当前页
					showPage:5,//显示页数
					totalPage:totalPage,//总页数
					onPageClick: function(page) {
						$("#orderPage").initPage(page);
						orderParam.pageNo = page.currentPage;
						base.postData(base.url.getGoodsOrderSpecListByGoodsId, orderParam, function(data) {
							if (data.success) {
								goodsOrderList(data.context);
							} else {
								toastr.error(data.msg);
							}
						});
		    			return false;  //默认的翻页事件
				    }
				};
				$("#orderPage").initPage(page);
			}
		}
		function pingOrderList(data){
			var html = '<tr>'+
						'	<td>'+data.takeDeliveryName+'</td>'+
						'	<td>'+data.phone+'</td>'+
						'	<td>'+data.address+'-'+data.detailedAddress+'</td>'+
						'	<td>'+data.orderMessage+'</td>'+
						'	<td>'+data.goodsPrice+'</td>'+
						'	<td>'+(data.payStatus == 0?'未支付':'已支付')+'</td>'+
						'	<td>'+data.specName+'</td>'+
						'	<td>'+data.specPrice+'</td>'+
						'	<td>'+data.purchaseNum+'</td>'+
						'	<td>'+data.paymentTime+'</td>'+
						'</tr>';
			return html;
		}
		//是否选择分销商品
		$("#isDistribution").change(function(){
			if ($(this).prop("checked")) {
				$("#distribution").show();
			}else{
				$("#distribution").hide();
			}
		});
		//导向文章数据表格
		$("#exportTable").click(function(){
			if ($("#goodsOrderTable tbody").find("tr").length == 0) {
				return;
			}
			window.location.href=base.url.exportGoodsOrderInfo+"?goodsID="+orderParam.goodsID;
		});
		function getVouchersList() {
			base.postData(base.url.getVouchersList, {userID:userID,companyID:companyID}, function(data){
				if (data.success) {
					$("#vouchersBody").html(getVouchersListHtml(data.context.vouchersList));
				}
			});
		}
		function getVouchersListHtml(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>'
				html += '	<td>'+(index*1+1)+'</td>'
				html += '	<td>'+list[index].vouchersPrice+'</td>'
				html += '	<td>'+list[index].fullRedPrice+'</td>'
				html += '	<td>'+list[index].vouchersStartTime+'</td>'
				html += '	<td>'+list[index].vouchersEndTime+'</td>'
				html += '	<td>'+list[index].voucherNumber +'</td>'
				html += '	<td><button class="btn btn-default vouchers-modify" data-vouchersID = "'+list[index].vouchersID+'">修改</button><button class="btn btn-default vouchers-del" data-vouchersID = "'+list[index].vouchersID+'">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		$('#vouchersPrice').bind('input propertychange', function() {
            $('#vouchersPriceSpan').html($(this).val());
        });
		//日期选择
    	$('#vcStartTime').datetimepicker({
		    format: 'yyyy.mm.dd',
		    language: 'zh-CN',
		    minView: 'month',
		    autoclose: true
		}).on("click", function(ev) {
		    $("#vcStartTime").datetimepicker("setEndDate", $("#vcEndTime").val());
		}).on("changeDate", function(ev) {
		    $("#vcEndTime").datetimepicker("setStartDate", $("#vcStartTime").val());
		    $('#vcEndTime').datetimepicker('show');
		});
		$('#vcEndTime').datetimepicker({
		    format: 'yyyy.mm.dd',
		    language: 'zh-CN',
		    minView: 'month',
		    autoclose: true
		}).on("click", function(ev) {
		    $("#vcEndTime").datetimepicker("setStartDate", $("#vcStartTime").val());
		}).on("changeDate", function(ev) {
	    		$('#vouchersValidityTime').html("有效期:"+$('#vcStartTime').val()+"~"+$("#vcEndTime").val());
		});
		$("#vouchersForm").validate({
		    rules: {
	    	  vouchersPrice: {digits:true},
		      vcStartTime: "required",
		      vcEndTime: "required",
		      voucherNumber: {digits:true}
		    },
		    messages: {
	    	  vouchersPrice: "请填入正确代金券价格",
		      vcStartTime: "开始时间不能为空",
		      vcEndTime: "结束时间不能为空",
		      voucherNumber: "代金券数量不能为空"
		    },
		    submitHandler: function() {
				var params = {
					userID:userID,
					companyID:companyID,
					vouchersID:vouchersID,
					vouchersPrice: $("#vouchersPrice").val(),
					fullRedPrice: $("#fullRedPrice").val(),
					vouchersStartTime:$("#vcStartTime").val(),
					vouchersEndTime:$("#vcEndTime").val(),
					voucherNumber:$("#voucherNumber").val(),
//					goodsID:$("#vouchersForm .goodsIDSt").val(),
					shareReadCount:$("#vouchersForm input[name='shareReadCount']").val(),
					articleID:$("#vouchersForm .articleIDS").val()
				}
				base.postData(base.url.addVouchers, params, function(data) {
					if (data.success) {
						initVouchersData();
						$("#addAndEditVouchersModal").modal("hide");
						toastr.success(data.msg);
						getVouchersList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		//点击修改获取活动详细
		$("#vouchersBody").on("click", ".vouchers-modify", function() {
			vouchersID = $(this).attr("data-vouchersID");
			base.postData(base.url.getVouchersById, {vouchersID:vouchersID}, function(data) {
				if (data.success) {
//					$("#vouchersForm .goodsIDSt").val(data.context.goodsID);
					$("#vouchersForm .articleIDS").val(data.context.articleID);
					$("#vouchersPrice").val(data.context.vouchersPrice);
					$("#fullRedPrice").val(data.context.fullRedPrice);
					$("#vcStartTime").val(data.context.vouchersStartTime);
					$("#vcEndTime").val(data.context.vouchersEndTime);
					$("#voucherNumber").val(data.context.voucherNumber);
					$('#vouchersPriceSpan').html(data.context.vouchersPrice);
					$("#vouchersForm input[name='shareReadCount']").val(data.context.shareReadCount);
					$('#vouchersValidityTime').html('有效期:'+data.context.vouchersStartTime+'~'+data.context.vouchersEndTime);
					$("#addAndEditVouchersModal").modal("show");
				} else {
					toastr.error(data.msg);
				}
			});
		})
		//删除活动
		$("#vouchersBody").on("click", ".vouchers-del", function() {
			var msg = confirm("确定要删除代金券吗！");
			if (msg == true){
				var _vouchersID = $(this).attr("data-vouchersID");
				base.postData(base.url.delVouchers, {vouchersID:_vouchersID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getVouchersList();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		});
		function getDiscountCouponsList() {
			base.postData(base.url.getDiscountCouponsList, {userID:userID,companyID:companyID}, function(data){
				if (data.success) {
					$("#discountBody").html(getDiscountListHtml(data.context.discountCouponsList));
				}
			});
		}
		function getDiscountListHtml(list) {
			var html = '';
			for (var index in list) {
				html += '<tr>'
				html += '	<td>'+(index*1+1)+'</td>'
				html += '	<td>'+list[index].discount+'</td>'
//				html += '	<td>'+list[index].goodsName+'</td>'
				html += '	<td>'+list[index].discountCouponsStartTime+'</td>'
				html += '	<td>'+list[index].discountCouponsEndTime+'</td>'
				html += '	<td>'+list[index].discountCouponsNumber +'</td>'
				html += '	<td><button class="btn btn-default discount-modify" data-discountID = "'+list[index].discountCouponsID+'">修改</button><button class="btn btn-default discount-del" data-discountID = "'+list[index].discountCouponsID+'">删除</button></td>'
				html += '</tr>'
			}
			return html;
		}
		$('#discountPrice').bind('input propertychange', function() {
            $('#discountPriceSpan').html($(this).val());
        });
		//日期选择
    	$('#dcStartTime').datetimepicker({
		    format: 'yyyy.mm.dd',
		    language: 'zh-CN',
		    minView: 'month',
		    autoclose: true
		}).on("click", function(ev) {
		    $("#dcStartTime").datetimepicker("setEndDate", $("#dcEndTime").val());
		}).on("changeDate", function(ev) {
		    $("#dcEndTime").datetimepicker("setStartDate", $("#dcStartTime").val());
		    $('#dcEndTime').datetimepicker('show');
		});
		$('#dcEndTime').datetimepicker({
		    format: 'yyyy.mm.dd',
		    language: 'zh-CN',
		    minView: 'month',
		    autoclose: true
		}).on("click", function(ev) {
		    $("#dcEndTime").datetimepicker("setStartDate", $("#dcStartTime").val());
		}).on("changeDate", function(ev) {
	    		$('#douchersValidityTime').html("有效期："+$('#dcStartTime').val()+"~"+$("#dcEndTime").val());
		});
		$("#discountForm").validate({
		    rules: {
		      discountPrice: {number:true, max:10},
		      dcStartTime: "required",
		      dcEndTime: "required",
		      discountNumber: {digits:true}
		    },
		    messages: {
		      discountPrice: "请填入正确折扣",
		      dcStartTime: "开始时间不能为空",
		      dcEndTime: "结束时间不能为空",
		      discountNumber: "打折券数量不能为空"
		    },
		    submitHandler: function() {
				var params = {
					userID:userID,
					companyID:companyID,
					discountCouponsID:discountCouponsID,
					discount:$("#discountPrice").val(),
//					goodsID:$("#discountForm .goodsIDSt").val(),
					discountCouponsStartTime:$("#dcStartTime").val(),
					discountCouponsEndTime:$("#dcEndTime").val(),
					discountCouponsNumber:$("#discountNumber").val(),
					shareReadCount:$("#discountForm input[name='shareReadCount']").val(),
					articleID:$("#discountForm .articleIDS").val()
				}
				base.postData(base.url.addDiscountCoupons, params, function(data) {
					if (data.success) {
						initDiscountData();
						$("#addAndEditDiscountModal").modal("hide");
						toastr.success(data.msg);
						getDiscountCouponsList();//刷新数据
					} else {
						toastr.error(data.msg);
					}
				});
		    }
		});
		//点击修改获取打折券详细
		$("#discountBody").on("click", ".discount-modify", function() {
			discountCouponsID = $(this).attr("data-discountID");
			base.postData(base.url.getDiscountCouponsById, {discountCouponsID:discountCouponsID}, function(data) {
				if (data.success) {
					//获得活动下拉框对象
//			        $("#discountForm .goodsIDSt").val(data.context.goodsID);
					$("#discountForm .articleIDS").val(data.context.articleID);
					$("#discountForm input[name='shareReadCount']").val(data.context.shareReadCount);
					$("#discountPrice").val(data.context.discount);
					$("#dcStartTime").val(data.context.discountCouponsStartTime);
					$("#dcEndTime").val(data.context.discountCouponsEndTime);
					$("#discountNumber").val(data.context.discountCouponsNumber);
					$('#discountPriceSpan').html(data.context.discount);
					$('#discountValidityTime').html('有效期：'+data.context.discountCouponsStartTime+'~'+data.context.discountCouponsEndTime);
					$("#addAndEditDiscountModal").modal("show");
				} else {
					toastr.error(data.msg);
				}
			});
		})
		//删除打折券
		$("#discountBody").on("click", ".discount-del", function() {
			var msg = confirm("确定要删除打折吗！");
			if (msg == true){
				var _discountID = $(this).attr("data-discountID");
				base.postData(base.url.delDiscountCoupons, {discountCouponsID:_discountID}, function(data) {
					if (data.success) {
						toastr.success(data.msg);
						getDiscountCouponsList();
					} else {
						toastr.error(data.msg);
					}
				});
			}
		});
		//获取文章列表
		function initArticleList(){
			var data = {
				userID:userID,
				companyID:companyID,
				keyword:"",
				type:1,
				pageNo:1
			}
			base.postData(base.url.getArticleList, data, callbackGetArticleList);
		}
		function callbackGetArticleList(data) {
			if (data.success) {
				//获得活动下拉框对象
				$(".articleIDS").empty();
				var option = '<option value="">请选择转发文章</option>';
		            $(".articleIDS").append(option);
				var list = data.context.myArticleList;
				for (var index in list) {
		            var option = '<option value="'+list[index].articleId+'">'+list[index].title+'</option>';
		            $(".articleIDS").append(option);
				}
			}else {
				toastr.warning(data.msg);
			}
		}
	</script>
</body>
</html>
